{"action":"closed","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3769","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3769/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3769/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3769/events","html_url":"https://github.com/orientechnologies/orientdb/issues/3769","id":62270740,"number":3769,"title":"Indexes with ignoreNullValues cause errors on new nodes in distributed mode","user":{"login":"tobiemh","id":1588290,"avatar_url":"https://avatars.githubusercontent.com/u/1588290?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiemh","html_url":"https://github.com/tobiemh","followers_url":"https://api.github.com/users/tobiemh/followers","following_url":"https://api.github.com/users/tobiemh/following{/other_user}","gists_url":"https://api.github.com/users/tobiemh/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiemh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiemh/subscriptions","organizations_url":"https://api.github.com/users/tobiemh/orgs","repos_url":"https://api.github.com/users/tobiemh/repos","events_url":"https://api.github.com/users/tobiemh/events{/privacy}","received_events_url":"https://api.github.com/users/tobiemh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/distributed","name":"distributed","color":"eb6420"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/waiting%20reply","name":"waiting reply","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"lvca","id":312606,"avatar_url":"https://avatars.githubusercontent.com/u/312606?v=3","gravatar_id":"","url":"https://api.github.com/users/lvca","html_url":"https://github.com/lvca","followers_url":"https://api.github.com/users/lvca/followers","following_url":"https://api.github.com/users/lvca/following{/other_user}","gists_url":"https://api.github.com/users/lvca/gists{/gist_id}","starred_url":"https://api.github.com/users/lvca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvca/subscriptions","organizations_url":"https://api.github.com/users/lvca/orgs","repos_url":"https://api.github.com/users/lvca/repos","events_url":"https://api.github.com/users/lvca/events{/privacy}","received_events_url":"https://api.github.com/users/lvca/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-03-17T03:12:39Z","updated_at":"2015-10-07T11:42:51Z","closed_at":"2015-10-07T11:42:51Z","body":"This error prevents being able to use indexes with `{ ignoreNullValues: false }` when in distributed mode.\r\n\r\nStart 3 servers in distributed mode (core-1, core-2, core-3)\r\n\r\n```sql\r\nCREATE DATABASE remote:172.17.8.101/testdatabase root root plocal graph\r\n```\r\n\r\nWait for database to sync across 3 nodes. Then...\r\n\r\n```sql\r\nCONNECT remote:172.17.8.101/testdatabase root root\r\nCREATE CLASS Person extends V\r\nCREATE PROPERTY Person.name STRING\r\nCREATE INDEX Person.name NOTUNIQUE METADATA { ignoreNullValues: false }\r\n```\r\n\r\nThen start node 4 and wait for database to sync across to new node (core-4). Then...\r\n\r\n```sql\r\nCONNECT remote:172.17.8.104/testdatabase root root\r\n\r\nCREATE VERTEX Person SET name = 'Tobie'\r\n# Created vertex 'Person#28:0{name:Tobie} v1' in 0.077000 sec(s).\r\n# This query works fine\r\n\r\nCREATE VERTEX Person SET temp = true\r\n# Created vertex 'Person#28:1{temp:true} v1' in 0.068000 sec(s).\r\n# This query causes the error, probably because it does not have a 'name' field\r\n```\r\n\r\nHowever an error occurs on the new node, and the data is now out of sync on the servers.\r\n\r\n```\r\nError on distributed transaction commit\r\ncom.orientechnologies.orient.core.index.sbtree.local.OSBTreeException: Null keys are not supported.\r\n   at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.checkNullSupport(OSBTree.java:769)\r\n   at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.get(OSBTree.java:185)\r\n   at com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine.get(OSBTreeIndexEngine.java:226)\r\n   at com.orientechnologies.orient.core.index.OIndexMultiValues.putInSnapshot(OIndexMultiValues.java:162)\r\n   at com.orientechnologies.orient.core.index.OIndexAbstract.applyIndexTxEntry(OIndexAbstract.java:1025)\r\n   at com.orientechnologies.orient.core.index.OIndexAbstract.addTxOperation(OIndexAbstract.java:690)\r\n   at com.orientechnologies.orient.core.tx.OTransactionOptimistic$CommitIndexesCallback.run(OTransactionOptimistic.java:98)\r\n   at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:922)\r\n   at com.orientechnologies.orient.server.distributed.ODistributedStorage.commit(ODistributedStorage.java:802)\r\n   at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:483)\r\n   at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:147)\r\n   at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2376)\r\n   at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2346)\r\n   at com.orientechnologies.orient.server.distributed.task.OTxTask.execute(OTxTask.java:111)\r\n   at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.executeOnLocalNode(OHazelcastPlugin.java:757)\r\n   at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.onMessage(ODistributedWorker.java:300)\r\n   at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.run(ODistributedWorker.java:121)\r\n[core-4] error on executing request 65 (tx) on local node:\r\ncom.orientechnologies.orient.core.index.sbtree.local.OSBTreeException: Null keys are not supported.\r\n   at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.checkNullSupport(OSBTree.java:769)\r\n   at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.get(OSBTree.java:185)\r\n   at com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine.get(OSBTreeIndexEngine.java:226)\r\n   at com.orientechnologies.orient.core.index.OIndexMultiValues.putInSnapshot(OIndexMultiValues.java:162)\r\n   at com.orientechnologies.orient.core.index.OIndexAbstract.applyIndexTxEntry(OIndexAbstract.java:1025)\r\n   at com.orientechnologies.orient.core.index.OIndexAbstract.addTxOperation(OIndexAbstract.java:690)\r\n   at com.orientechnologies.orient.core.tx.OTransactionOptimistic$CommitIndexesCallback.run(OTransactionOptimistic.java:98)\r\n   at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:922)\r\n   at com.orientechnologies.orient.server.distributed.ODistributedStorage.commit(ODistributedStorage.java:802)\r\n   at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:483)\r\n   at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:147)\r\n   at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2376)\r\n   at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2346)\r\n   at com.orientechnologies.orient.server.distributed.task.OTxTask.execute(OTxTask.java:111)\r\n   at com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin.executeOnLocalNode(OHazelcastPlugin.java:757)\r\n   at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.onMessage(ODistributedWorker.java:300)\r\n   at com.orientechnologies.orient.server.hazelcast.ODistributedWorker.run(ODistributedWorker.java:121)\r\n\r\n2015-03-17 02:42:48:468 WARNING [core-4] detected 1 conflicts, but the quorum (2) has been reached. Fixing remote records. Request (id=65 from=core-4 task=tx userName=) [ODistributedResponseManager]\r\n```\r\n\r\nNOTE:\r\n- The index is fine and works correctly before the new node (core-4) is added to the cluster.\r\n- If the index is defined as `CREATE INDEX Person.name NOTUNIQUE` without the `METADATA { ignoreNullValues: false }` then the error does not occur.\r\n\r\n***\r\n\r\nOrientDB version: 2.0.5"}}