orientdb
orientdb copied to clipboard
Create index failed with java.lang.NullPointerException on distributed `Edge`
OrientDB Version: 3.2.3
Java Version: 11.0.13
OS: Docker based on ubi8
Hosts: 1 x master and 2 x replicas
Expected behavior
Create an index between properties type LINK in Edge class, it works on single instance setup but failed on distributed system setup.
Actual behavior
I have a Edge Class named "Edge" (legacy...), I have 4 properties:
- my_name STRING
- in LINK
- out LINK
- relation STRING
I try to add a index type NOTUNIQUE_HASH_INDEX with fields in and out
create index Edge_index on `Edge` (in, out) NOTUNIQUE_HASH_INDEX
When I execute the index creation from: Scala, Orientdb Studio query or web form I got the same java.lang.NullPointerException.
I got this stack strace from Scala call:
java.lang.NullPointerException: null
at com.orientechnologies.orient.core.index.OIndexManagerShared.preProcessBeforeReturn(OIndexManagerShared.java:791)
at com.orientechnologies.orient.server.distributed.impl.metadata.OIndexManagerDistributed.distributedCreateIndex(OIndexManagerDistributed.java:124)
at com.orientechnologies.orient.server.distributed.impl.metadata.OIndexManagerDistributed.createIndex(OIndexManagerDistributed.java:71)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.createIndex(OClassImpl.java:1110)
at com.orientechnologies.orient.core.sql.parser.OCreateIndexStatement.getoIndex(OCreateIndexStatement.java:167)
at com.orientechnologies.orient.core.sql.parser.OCreateIndexStatement.execute(OCreateIndexStatement.java:148)
at com.orientechnologies.orient.core.sql.parser.OCreateIndexStatement.executeDDL(OCreateIndexStatement.java:53)
at com.orientechnologies.orient.core.sql.executor.ODDLExecutionPlan.executeInternal(ODDLExecutionPlan.java:51)
at com.orientechnologies.orient.core.sql.parser.ODDLStatement.execute(ODDLStatement.java:40)
at com.orientechnologies.orient.core.sql.parser.OStatement.execute(OStatement.java:72)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.command(ODatabaseDocumentEmbedded.java:633)
at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeQuery(OConnectionBinaryExecutor.java:1342)
at com.orientechnologies.orient.client.remote.message.OQueryRequest.execute(OQueryRequest.java:143)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:355)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:239)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:68)
Wrapped by: com.orientechnologies.orient.core.exception.OStorageException: Error on executing command: create index Edge_index on `Edge` (in, out) NOTUNIQUE_HASH_INDEX
DB name=\u0022damgraph\u0022
at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:532)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationRetryTimeout(OStorageRemote.java:381)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationNoRetry(OStorageRemote.java:416)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:1184)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.command(ODatabaseDocumentRemote.java:421)
at io.kensu.graph.orientdb.migrations.InitBaseOrientDBModelMigration.$anonfun$migrate$13(InitBaseOrientDBModelMigration.scala:115)
at io.kensu.graph.orientdb.migrations.MigrationOps.forMandatoryClass(MigrationOps.scala:37)
at io.kensu.graph.orientdb.migrations.MigrationOps.forMandatoryClass$(MigrationOps.scala:31)
at io.kensu.graph.orientdb.migrations.InitBaseOrientDBModelMigration.forMandatoryClass(InitBaseOrientDBModelMigration.scala:21)
at io.kensu.graph.orientdb.migrations.InitBaseOrientDBModelMigration.$anonfun$migrate$1(InitBaseOrientDBModelMigration.scala:111)
at io.kensu.graph.orientdb.migrations.InitBaseOrientDBModelMigration.$anonfun$migrate$1$adapted(InitBaseOrientDBModelMigration.scala:32)
at io.kensu.graph.orientdb.OrientService.$anonfun$withDriverNoTx$1(OrientService.scala:72)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:672)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
"}}
Steps to reproduce
CREATE CLASS `Edge` EXTENDS E
CREATE PROPERTY `Edge`.my_name STRING
CREATE PROPERTY `Edge`.in LINK
CREATE PROPERTY `Edge`.out LINK
CREATE PROPERTY `Edge`.relation STRING
create index Edge_index on `Edge` (in, out) NOTUNIQUE_HASH_INDEX