orientdb: OConcurrentModificationException occurs when insert after delete
OrientDB Version: 3.0.0.SNAPSHOT
Java Version: 1.8
OS: CentOS
When I insert massive edges, I get below exception occasionally.
com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #156:26159 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v3 your=v2)
DB name="test"
DB name="test"
Error Code="3"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_131]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_131]
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:318) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:275) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:191) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:153) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1693) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.OStorageRemote.lambda$networkOperationRetryTimeout$2(OStorageRemote.java:226) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:279) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationRetryTimeout(OStorageRemote.java:214) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperation(OStorageRemote.java:243) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:835) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:68) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.tinkerpop.blueprints.impls.orient.OrientGraphCommand.execute(OrientGraphCommand.java:49) ~[orientdb-graphdb-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.haizhi.graph.lab.orientdb.orientdb.runner.HbaseRelationScan.lambda$null$14(HbaseRelationScan.java:354) ~[classes!/:1.0-SNAPSHOT]
at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_131]
at com.haizhi.graph.lab.orientdb.orientdb.runner.HbaseRelationScan.lambda$saveByBatchQueryWithoutCache$15(HbaseRelationScan.java:344) ~[classes!/:1.0-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_131]
Suppressed: com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #156:26159 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v3 your=v2)
DB name="test"
at com.orientechnologies.orient.core.conflict.OVersionRecordConflictStrategy.checkVersions(OVersionRecordConflictStrategy.java:56) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.conflict.OVersionRecordConflictStrategy.onUpdate(OVersionRecordConflictStrategy.java:43) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.checkAndIncrementVersion(OAbstractPaginatedStorage.java:4733) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doUpdateRecord(OAbstractPaginatedStorage.java:4221) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commitEntry(OAbstractPaginatedStorage.java:4793) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:1878) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:1736) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.internalCommit(ODatabaseDocumentAbstract.java:3020) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:539) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:103) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.commit(ODatabaseDocumentAbstract.java:2456) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.commit(ODatabaseDocumentAbstract.java:2419) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateEdge.execute(OCommandExecutorSQLCreateEdge.java:225) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:74) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:3658) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:3595) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:68) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeCommand(OConnectionBinaryExecutor.java:581) ~[orientdb-server-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.client.remote.message.OCommandRequest.execute(OCommandRequest.java:103) ~[orientdb-client-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:276) ~[orientdb-server-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:182) ~[orientdb-server-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:82) ~[orientdb-core-3.0.0-SNAPSHOT.jar!/:3.0.0-SNAPSHOT]
In this error log, #156:26159 is an edge. Before this massive edge inserting, I have ran delete command to delete all datas of this edge collection. But I can’t make sure if it was causes by the delete operation.
If I create a new edge collection and and re-insert all the datas (without run the delete command), it woks well.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 20 (8 by maintainers)
Commits related to this issue
- added missing rollback in case of database pool close, issue #7940 — committed to orientechnologies/orientdb by tglman 6 years ago
Any updates on this?
With the fix for OrientJS queries getting queued up: https://github.com/orientechnologies/orientjs/commit/5acca8b53b7fdd426c0b2ad203ede0d90caf0007 I am also facing the same
OConcurrentModificationExceptionissue.Any workaround for this ?