I'm running OrientDB (community edition 2.2.9) in distributed mode with multiple nodes.
After a couple of minutes, I start getting the following error on my queries:
com.orientechnologies.orient.server.distributed.task.ODistributedRecordLockedException: Timeout (1500ms) on acquiring lock on record #1010:2651. It is locked by request 3.1000 DB name="MyDatabase"
The query in this instance looks like this:
UPDATE #1010:2651 SET name='foo';
The record remains locked and I can't run the query until I restart the database.
If I don't run the server in distributed mode, I don't get this error so it must have something to do with running it in distributed mode.
Here is my default-distributed-db-config.json
{
"autoDeploy": true,
"readQuorum": 1,
"writeQuorum": 1,
"executionMode": "asynchronous",
"readYourWrites": true,
"servers": {
"*": "master"
},
"clusters": {
"internal": {
},
"*": {
"servers": ["<NEW_NODE>"]
}
}
}
I was using the following configuration in my orientdb-server-config.xml:
....
<handler class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin">
<parameters>
....
<parameter value="com.orientechnologies.orient.server.distributed.conflict.ODefaultReplicationConflictResolver" name="conflict.resolver.impl"/>
....
</parameters>
</handler>
...
By removing the "ODefaultReplicationConflictResolver" paramter from the config, the locking issue happens less frequently.
Why are the records locking up like this and how can I avoid it?