Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 - Found null entry in ridbag with rid=#26:-2 #7481

Closed
careerscale opened this issue Jun 9, 2017 · 9 comments
Closed

3.0 - Found null entry in ridbag with rid=#26:-2 #7481

careerscale opened this issue Jun 9, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@careerscale
Copy link

OrientDB Version: 3.0

Java Version: 1.8

OS: Win 7

Expected behavior

code should work.

Actual behavior

`com.orientechnologies.orient.core.exception.OSerializationException: Found null entry in ridbag with rid=#26:-2
DB name="test1"
at com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag.serialize(OEmbeddedRidBag.java:424)
at com.orientechnologies.orient.core.db.record.ridbag.ORidBag.toStream(ORidBag.java:269)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerNetworkV37.serializeValue(ORecordSerializerNetworkV37.java:498)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerNetworkV37.serialize(ORecordSerializerNetworkV37.java:149)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerNetworkV37.toStream(ORecordSerializerNetworkV37.java:775)
at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeTransactionEntry(OMessageHelper.java:201)
at com.orientechnologies.orient.client.remote.message.OBeginTransactionRequest.write(OBeginTransactionRequest.java:76)
at com.orientechnologies.orient.client.remote.OStorageRemote$2.execute(OStorageRemote.java:215)
at com.orientechnologies.orient.client.remote.OStorageRemote$2.execute(OStorageRemote.java:210)
at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:274)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationRetryTimeout(OStorageRemote.java:210)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperation(OStorageRemote.java:238)
at com.orientechnologies.orient.client.remote.OStorageRemote.reBeginTransaction(OStorageRemote.java:1783)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.checkAndSendTransaction(ODatabaseDocumentRemote.java:258)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.command(ODatabaseDocumentRemote.java:292)
at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.lambda$executeSql$1(OrientGraph.java:245)
at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.executeWithConnectionCheck(OrientGraph.java:194)
at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.executeSql(OrientGraph.java:243)
at com.orientdb.samples.test.RidBagErrorTest.testforRidBagError(RidBagErrorTest.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

`

Steps to reproduce

create a test db and use right credentials here.
https://github.com/careerscale/orientdb-demo/blob/master/orientdb-java-sample/src/test/java/com/orientdb/samples/test/RidBagErrorTest.java

@careerscale careerscale changed the title Found null entry in ridbag with rid=#26:-2 3.0 - Found null entry in ridbag with rid=#26:-2 Jun 9, 2017
@careerscale
Copy link
Author

careerscale commented Jun 9, 2017

@lvca @luigidellaquila

basic analysis shows that when there are multiple look ups for the same vertex in the same transaction there seems to be problem.

If I do not use FOR loop and read all vertices upfront and add edges, then it all works well.

so must be easy to fix or there do you think this is wrong way of doing thing, but there is nothing stopping me to do multiple look ups and operate on the same vertex on differently.

    public void testforRidBagError() {
        // Block for creating employees
        OrientGraph graph1 = factory.getTx();
        OrientGraph graph2 = factory.getTx();
        try {
            // Creating employees
            Vertex empVertex1 = graph1.addVertex(T.label, EMPLOYEE, NAME, "first +  last" + new Random().nextDouble(),
                    STREET, "Street" + new Random().nextDouble());
            Vertex empVertex2 = graph1.addVertex(T.label, EMPLOYEE, NAME, "first +  last" + new Random().nextDouble(),
                    STREET, "Street" + new Random().nextDouble());
            Vertex empVertex3 = graph1.addVertex(T.label, EMPLOYEE, NAME, "first +  last" + new Random().nextDouble(),
                    STREET, "Street" + new Random().nextDouble());
            Vertex empVertex4 = graph1.addVertex(T.label, EMPLOYEE, NAME, "first +  last" + new Random().nextDouble(),
                    STREET, "Street" + new Random().nextDouble());
            Vertex empVertex5 = graph1.addVertex(T.label, EMPLOYEE, NAME, "first +  last" + new Random().nextDouble(),
                    STREET, "Street" + new Random().nextDouble());

            graph1.commit();
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        } finally {
            if (null != graph1 && !graph1.isClosed()) {
                graph1.close();
            }
        }



        // Block for testing the created employees count
        int count = 0;
        try {


            for (int i = 1; i < 5; i++) {
                Vertex e1 =
                        graph2.executeSql("select from Employee where id  = ? ", i).iterator().next().getVertex().get();
                Vertex e2 = graph2.executeSql("select from Employee where id  = ? ", i + 1).iterator().next()
                        .getVertex().get();
                e1.addEdge(MANAGES, e2);
            }

            graph2.commit();

        } catch (Exception e) {
            graph2.rollback();
            e.printStackTrace();
        } finally {
            if (null != graph2 && !graph2.isClosed()) {
                graph2.close();
            }
        }


@tglman
Copy link
Member

tglman commented Jun 12, 2017

hi @careerscale,

Friday I pushed a couple of fixes on the tx and temporary rid generation and similar, I run your code with the last snapshot and seems to go smooth, so this should be fixed with the last snapshot.

Regards

@tglman tglman added this to the 3.0 milestone Jun 12, 2017
@careerscale
Copy link
Author

@tglman @luigidellaquila , please let me know if a specific build is found to be stable and I will validate and if good we will move to use that DB instance only.

I was waiting for HA feature merge into develop branch from 2.2.x, looks like it is not yet done.

@lvca
Copy link
Member

lvca commented Jun 13, 2017

It's taking more than expected, I'm working on a separate local branch until is ok.

@careerscale
Copy link
Author

@tglman @lvca any update on this one? is it going take time for this one?

@careerscale
Copy link
Author

@tglman,

the unit test code now breaks with different error. is this application problem? but the error is not clear so I think it could be bug.

java.lang.IllegalStateException
	at com.orientechnologies.orient.client.remote.message.ORemoteResultSet.next(ORemoteResultSet.java:55)
	at org.apache.tinkerpop.gremlin.orientdb.executor.OGremlinResultSet$1.next(OGremlinResultSet.java:60)
	at org.apache.tinkerpop.gremlin.orientdb.executor.OGremlinResultSet$1.next(OGremlinResultSet.java:52)
	at com.orientdb.samples.test.RidBagErrorTest.testforRidBagError(RidBagErrorTest.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
FAILED: testforRidBagError
java.lang.IllegalStateException
	at com.orientechnologies.orient.client.remote.message.ORemoteResultSet.next(ORemoteResultSet.java:55)
	at org.apache.tinkerpop.gremlin.orientdb.executor.OGremlinResultSet$1.next(OGremlinResultSet.java:60)
	at org.apache.tinkerpop.gremlin.orientdb.executor.OGremlinResultSet$1.next(OGremlinResultSet.java:52)
	at com.orientdb.samples.test.RidBagErrorTest.testforRidBagError(RidBagErrorTest.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

@tglman
Copy link
Member

tglman commented Jun 27, 2017

hi @careerscale,

This IllegalStateException error actually means that the are no more elements in the result set anymore, we replaced with NoSuchElementException recently should be already correct in the last snapshot.

regards

@careerscale
Copy link
Author

Hi @tglman ,

yah, I modified unit test and it looks OK. will verify in our application too and confirm

@careerscale
Copy link
Author

This works good.

@robfrank robfrank modified the milestones: 3.0, 3.0.0-M2 Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants