apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.62k stars 518 forks source link

[Bug] Transaction resolution unknown #1860

Closed shenbinglife closed 2 years ago

shenbinglife commented 2 years ago

Bug Type (问题类型)

other exception / error (其他异常报错)

Before submit

Environment (环境信息)

Expected & Actual behavior (期望与实际表现)

2022-05-04 22:00:03 878304910 [grizzly-http-server-25] [ERROR] com.baidu.hugegraph.server.RestServer [] - Failed to rollback
com.baidu.hugegraph.backend.BackendException: Failed to rollback
        at com.baidu.hugegraph.backend.store.mysql.MysqlSessions$Session.rollback(MysqlSessions.java:434) ~[hugegraph-mysql-0.11.2.jar:?]
        at com.baidu.hugegraph.backend.store.mysql.MysqlStore.rollbackTx(MysqlStore.java:311) ~[hugegraph-mysql-0.11.2.jar:?]
        at com.baidu.hugegraph.backend.tx.AbstractTransaction.rollback(AbstractTransaction.java:235) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.backend.tx.IndexableTransaction.rollback(IndexableTransaction.java:72) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.backend.tx.GraphTransaction.rollback(GraphTransaction.java:507) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.StandardHugeGraph$Txs.rollback(StandardHugeGraph.java:1267) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.StandardHugeGraph$TinkerPopTransaction.doRollback(StandardHugeGraph.java:1149) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.rollback(AbstractTransaction.java:114) ~[gremlin-core-3.4.3.jar:3.4.3]
        at com.baidu.hugegraph.StandardHugeGraph$TinkerPopTransaction.rollback(StandardHugeGraph.java:1118) ~[hugegraph-core-0.11.2.jar:0.11.2.0]
        at com.baidu.hugegraph.api.API.lambda$commit$0(API.java:89) ~[hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.api.API.commit(API.java:107) [hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.api.API.commit(API.java:118) [hugegraph-api-0.11.2.jar:0.58.0.0]
        at com.baidu.hugegraph.api.graph.VertexAPI.update(VertexAPI.java:215) [hugegraph-api-0.11.2.jar:0.58.0.0]
        at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_272]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_272]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [jersey-common-2.25.1.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [jersey-common-2.25.1.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [jersey-common-2.25.1.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [jersey-common-2.25.1.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [jersey-common-2.25.1.jar:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [jersey-common-2.25.1.jar:?]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [jersey-server-2.25.1.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) [jersey-container-grizzly2-http-2.25.1.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:200) [grizzly-http-server-2.4.4.jar:2.4.4]
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569) [grizzly-framework-2.4.4.jar:2.4.4]
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549) [grizzly-framework-2.4.4.jar:2.4.4]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during rollback(). Transaction resolution unknown.
        at sun.reflect.GeneratedConstructorAccessor72.newInstance(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.mysql.jdbc.Util.getInstance(Util.java:408) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4576) ~[mysql-connector-java-5.1.45.jar:5.1.45]
        at com.baidu.hugegraph.backend.store.mysql.MysqlSessions$Session.rollback(MysqlSessions.java:432) ~[hugegraph-mysql-0.11.2.jar:?]
        ... 37 more

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

javeme commented 2 years ago

Could you please provide steps to reproduce?

shenbinglife commented 2 years ago

can not. The program has just 10 thead doing too many write operations and less select operations, the source code is complex with busniess .

Is there any command to see how many Vertex and Edge?

javeme commented 2 years ago

Is there any command to see how many Vertex and Edge?

please try g.V().count() or g.E().count()

shenbinglife commented 2 years ago

Vertex 27894, Edge 79764。

more problem with Xmx20G , javax.ws.rs.ServiceUnavailableException: The server available memory 62(MB) is below than threshold 64(MB) and can't process the request, you can config restserver.min_free_memory to adjust it or try again later

Is Xmx memory enough ?

javeme commented 2 years ago

Looks like a resource leak problem #1818 You can try hugegraph v0.12.0 which has fixed this issue: https://hugegraph.github.io/hugegraph-doc/download.html

shenbinglife commented 2 years ago

Any upgrade guide need ?

when i just start 0.12 hugegraph with old database, it failed .

[main] [ERROR] c.b.h.d.HugeGraphServer - HugeRestServer start error:
com.baidu.hugegraph.backend.BackendException: The backend store version is inconsistent
javeme commented 2 years ago

We should create a new environment since the store version has changed, then migrate the data from v0.11 to v0.12.

shenbinglife commented 2 years ago

thanks, More stable after using the new version 0.12