Closed tobiemh closed 9 years ago
This still exists in OrientDB Version 2.0.6 and 2.0.7
The bug removes the possibility of using indexes with ignoreNullValues in a distributed setup. The bug prevents being able to add a database on 1 node, and then start up other nodes in distributed setup.
Rebuilding ALL of the indexes on ALL of the servers does not fix the issue.
If you try to create a vertex/edge which belong to a class which has an ignoreNullValues index then the following error will appear...
orient|com.orientechnologies.orient.core.index.sbtree.local.OSBTreeException: Null keys are not supported.
orient| at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.checkNullSupport(OSBTree.java:769)
orient| at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.get(OSBTree.java:185)
orient| at com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine.get(OSBTreeIndexEngine.java:226)
orient| at com.orientechnologies.orient.core.index.OIndexMultiValues.putInSnapshot(OIndexMultiValues.java:162)
orient| at com.orientechnologies.orient.core.index.OIndexAbstract.applyIndexTxEntry(OIndexAbstract.java:1025)
orient| at com.orientechnologies.orient.core.index.OIndexAbstract.addTxOperation(OIndexAbstract.java:690)
orient| at com.orientechnologies.orient.core.tx.OTransactionOptimistic$CommitIndexesCallback.run(OTransactionOptimistic.java:98)
orient| at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:922)
orient| at com.orientechnologies.orient.server.distributed.ODistributedStorage.commit(ODistributedStorage.java:811)
orient| at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:483)
orient| at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:147)
orient| at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2406)
orient| at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2376)
orient| at com.orientechnologies.orient.server.distributed.task.OTxTask.execute(OTxTask.java:113)
orient| at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.executeOnLocalNode(OHazelcastPlugin.java:772)
orient| at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.onMessage(ODistributedWorker.java:300)
orient| at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.run(ODistributedWorker.java:121)
Anyone have any idea how to get round this?
Hi @lvca - any possibility of this being marked as a bug?
Is there any latest info on this issue?
I created this test case and everything works: https://github.com/orientechnologies/orientdb/commit/f97cccb32860eedf8cda7b54983761290488a305. I don't know if this has been fixed in 2.1-SNAPSHOT (develop branch). Could you please try with 2.1-SNAPSHOT?
The issue has been closed because no response has been received after a while. In case the issue is still valid, please reopen it or write a comment that explains why it's still valid and a way to reproduce it. Thank you.
I ran into this exact issue in version 2.1.15. I have the following schema.
{
"@type":"d",
"@rid":"#15:147",
"@version":1,
"@class":"MToken",
"user":"#12:3",
"expiration":1460820192,
"lastUsed":1460776992,
"description":null,
"token":"3_26j8C0fvxyiyJg2-b_nie1ynSRA-1QldkEb2cKGmA",<-- unique non-null Index on this field
"created":1460776992,
}
{
"@type":"d",
"@rid":"#12:3",
"@version":160,
"@class":"MUser",
"email":"sample@sample.com", <-- unique non-null Index on this field
"firstName":"Sample",
"lastName":"User",
"enabled":true,
"properties":{
},
"created":1460614838,
"loginDate":1460776984,
"tokens":[
<null>, <-- reference to deleted record
...
<null>, <-- reference to deleted record
"#15:147"
],
}
My Token and user objects have a circular reference that is enforced by java hooks. My application works perfectly when not running in distributed mode. When I enable distributed mode I got the same exception as @tobiemh. I was also getting zero records returned when I would query my Token.token index, or run the following query.
SELECT FROM MToken where token = '3_26j8C0fvxyiyJg2-b_nie1ynSRA-1QldkEb2cKGmA'
What I eventually figured out is that some of my User objects had references to deleted tokens in the tokens embedded link set due to deleted records that escaped my AFTER_DELETE hook. Once I removed these null links with the following command, distributed mode started working correctly.
update MUser remove tokens = null
The rebuild index functionality seems to be attempting to index these null references when in distributed mode.
This error prevents being able to use indexes with
{ ignoreNullValues: false }
when in distributed mode.Start 3 servers in distributed mode (core-1, core-2, core-3)
Wait for database to sync across 3 nodes. Then...
Then start node 4 and wait for database to sync across to new node (core-4). Then...
However an error occurs on the new node, and the data is now out of sync on the servers.
NOTE:
CREATE INDEX Person.name NOTUNIQUE
without theMETADATA { ignoreNullValues: false }
then the error does not occur.OrientDB version: 2.0.5