orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Gremlin query returns same record multiple times

Open suneelkumarch opened this issue 1 year ago • 3 comments

OrientDB Version: 3.2.2

Java Version:

OS: Host : Linux, runtime: Docker

Expected behavior

database schema: Vertex class 'object_model' with properties, 's_model' and 's_id'. Has INDEX 's_model' and 's_id' as a composite key

Edge class 'has_model' with property 's_id'

Performed record creation and deletions. After this with few records present in DB.

Following gremiln and SQL queries are expected to return a single record.

g.V().hasLabel('object_model').as('m').has('s_model','sample').has('s_id','53d28bb7-ddc9-47f0-a71f-c626ac1faef5')

SELECT * FROM object_model WHERE 's_id = '53d28bb7-ddc9-47f0-a71f-c626ac1faef5'

Actual behavior

Gremlin query returning the same record indefinitely. SQL query is returning the requested record and along with it all the records in the database.

suneelkumarch avatar Apr 13 '23 05:04 suneelkumarch

Hi,

Can you try this again with a recent hotfix (current 3.2.18) ? I think this has already been fixed in recent versions.

Regards

tglman avatar Apr 14 '23 13:04 tglman

@tglman Thanks for the quick response.

I am running Orientdb, with gremlin, as docker container. To refer to the 3.2.18 version of the OrientDB, I have used 3.2.18-tp3.

Couple of observations:

  • Unable to read scriptEvaluationTimeout property Error: 023-04-16 18:56:55:581 FINE Failed to find field for org.apache.tinkerpop.gremlin.server.Settings.plugins [introspector] 2023-04-16 18:56:55:621 SEVER Error on Gremlin Server startup [OGremlinServerPlugin] Cannot create property=scriptEvaluationTimeout for JavaBean=org.apache.tinkerpop.gremlin.server.Settings@2a46f698 in 'reader', line 2, column 1: host: 0.0.0.0 ^ Unable to find property 'scriptEvaluationTimeout' on class: org.apache.tinkerpop.gremlin.server.Settings in 'reader', line 4, column 26: scriptEvaluationTimeout: 6000000 ^ at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:288) at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:174) at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:325) at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:235) at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:224) at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:178) at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:162) at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:477) at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:470) at org.apache.tinkerpop.gremlin.server.Settings.read(Settings.java:400) at com.orientechnologies.tinkerpop.server.OGremlinServerPlugin.onAfterActivate(OGremlinServerPlugin.java:80) at com.orientechnologies.orient.server.OServer.activate(OServer.java:489) at com.orientechnologies.orient.server.OServerMain$1.run(OServerMain.java:49) Caused by: org.yaml.snakeyaml.error.YAMLException: Unable to find property 'scriptEvaluationTimeout' on class: org.apache.tinkerpop.gremlin.server.Settings at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:155) at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:145) at org.yaml.snakeyaml.TypeDescription.discoverProperty(TypeDescription.java:239) at org.yaml.snakeyaml.TypeDescription.getProperty(TypeDescription.java:250) at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:229) ... 12 more 2023-04-16 18:56:55:624 INFO OrientDB Studio available at http://10.0.1.53:2480/studio/index.html [OServer]

  • I am using OrientDB docker image version 3.2.2-tp3. When I upgraded to 3.2.18-tp3, it failed to load the the database with following error:
    Database has been opened at version 3.2.2 (build 6df1d1942b88896dabea123fe1b8b0c6975e025a, branch UNKNOWN) but is attempted to be restored at version 3.2.18 details: SEVER Exception during storage data restore [OLocalPaginatedStorage] com.orientechnologies.orient.core.exception.OStorageException: Database has been opened at version 3.2.2 (build 6df1d1942b88896dabea123fe1b8b0c6975e025a, branch UNKNOWN) but is attempted to be restored at version 3.2.18 (build 75890139e2e64b786a59c95b913af9fbb86c5cfc, branch UNKNOWN). Please use correct version to restore database. at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.recoverIfNeeded(OAbstractPaginatedStorage.java:5064) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:529) at com.orientechnologies.orient.core.db.OrientDBEmbedded.getAndOpenStorage(OrientDBEmbedded.java:590) at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:541) at com.orientechnologies.orient.core.db.OrientDBDistributed.open(OrientDBDistributed.java:253) at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:481) at com.orientechnologies.orient.core.db.OrientDBDistributed.open(OrientDBDistributed.java:238) at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:852) at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:845) at com.orientechnologies.orient.server.network.protocol.http.command.OServerCommandAuthenticatedDbAbstract.authenticate(OServerCommandAuthenticatedDbAbstract.java:194) at com.orientechnologies.orient.server.network.protocol.http.command.OServerCommandAuthenticatedDbAbstract.beforeExecute(OServerCommandAuthenticatedDbAbstract.java:136) at com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetConnect.beforeExecute(OServerCommandGetConnect.java:55) at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:239) at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:800) at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:68) 2023-04-16 19:14:49:176 SEVER Exception 36BA4C28in storageplocal:/orientdb/databases/abbodb: 3.2.18 (build 75890139e2e64b786a59c95b913af9fbb86c5cfc, branch UNKNOWN) [OLocalPaginatedStorage] com.orientechnologies.orient.core.exception.OStorageException: Database has been opened at version 3.2.2 (build 6df1d1942b88896dabea123fe1b8b0c6975e025a, branch UNKNOWN) but is attempted to be restored at version 3.2.18 (build 75890139e2e64b786a59c95b913af9fbb86c5cfc, branch UNKNOWN). Please use correct version to restore database. at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.recoverIfNeeded(OAbstractPaginatedStorage.java:5064) at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:529) at com.orientechnologies.orient.core.db.OrientDBEmbedded.getAndOpenStorage(OrientDBEmbedded.java:590) at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:541) at com.orientechnologies.orient.core.db.OrientDBDistributed.open(OrientDBDistributed.java:253) at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:481) at com.orientechnologies.orient.core.db.OrientDBDistributed.open(OrientDBDistributed.java:238) at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:852) at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:845) at com.orientechnologies.orient.server.network.protocol.http.command.OServerCommandAuthenticatedDbAbstract.authenticate(OServerCommandAuthenticatedDbAbstract.java:194) at com.orientechnologies.orient.server.network.protocol.http.command.OServerCommandAuthenticatedDbAbstract.beforeExecute(OServerCommandAuthenticatedDbAbstract.java:136) at com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetConnect.beforeExecute(OServerCommandGetConnect.java:55) at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:239) at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:800)

Not much of clue from OrientDB Upgrade manual.

Any thoughts on these would be greatly appreciated!

suneelkumarch avatar Apr 16 '23 19:04 suneelkumarch

@tglman Btw, the initial observation that i have posted (gremlin query returning duplicate records), I understand this is due to corrupted INDEXES. I tried preform REBUILD INDEX, but OrientDB server did not complete the request and stopped responding to any subsequent requests. Following are Indexes used: CREATE INDEX object.s_Id IF NOT EXISTS ON object(s_Id) UNIQUE CREATE INDEX object_model.s_Id_s_model IF NOT EXISTS ON object_model(s_Id,s_model) UNIQUE

suneelkumarch avatar Apr 16 '23 19:04 suneelkumarch