[Bug] rocksdb删除图后,无法再次创建相同名字的图

Open
#2,712 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api, database

Research direction

Reproduce the delete-and-recreate flow with the RocksDB backend, then inspect the close path in StandardHugeGraph and the open paths in RocksDBStore.java and RocksDBStdSessions.java. Check how the graph transaction and RocksDB LOCK are released after deletion; done means the same graph name can be created again without the lock or graph-opening errors shown.

Written by the indexing model from the issue text.

Description

api bug rocksdb
Bug Type (问题类型)

rest-api (结果不合预期)

Before submit
  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
Environment (环境信息)
  • Server Version: 1.5.0
  • Backend: RocksDB
  • OS: docker
  • Data Size: 空图
Expected & Actual behavior (期望与实际表现)
2024-12-25 02:17:08 [grizzly-http-server-2] [INFO] o.a.h.StandardHugeGraph - Graph 'hugegraph2' has been cleared
2024-12-25 02:17:08 [grizzly-http-server-2] [INFO] o.a.h.StandardHugeGraph - Close graph standardhugegraph[hugegraph2]
2024-12-25 02:17:08 [grizzly-http-server-2] [WARN] o.a.h.StandardHugeGraph - Failed to close graph standardhugegraph[hugegraph2] java.lang.IllegalStateException: Ensure tx closed in all threads when closing graph 'hugegraph2'
2024-12-25 02:17:08 [event-worker-105] [WARN] o.a.h.StandardHugeGraph - The tx is not closed while graph 'standardhugegraph[hugegraph2]' is closed
2024-12-25 02:18:30 [db-open-1] [INFO] o.a.h.b.s.r.RocksDBStore - Opening RocksDB with data path: rocksdb-data/data/hugegraph2/m
2024-12-25 02:18:30 [db-open-1] [ERROR] o.a.h.b.s.r.RocksDBStore - Failed to open RocksDB 'rocksdb-data/data/hugegraph2/m'
org.rocksdb.RocksDBException: lock hold by current process, acquire time 1735092622 acquiring thread 140227226007296: rocksdb-data/data/hugegraph2/m/LOCK: No locks available
        at org.rocksdb.RocksDB.open(Native Method) ~[rocksdbjni-7.2.2.jar:?]
        at org.rocksdb.RocksDB.open(RocksDB.java:305) ~[rocksdbjni-7.2.2.jar:?]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStdSessions.openRocksDB(RocksDBStdSessions.java:413) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStdSessions.<init>(RocksDBStdSessions.java:102) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.openSessionPool(RocksDBStore.java:379) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:312) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:304) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.lambda$open$3(RocksDBStore.java:227) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
2024-12-25 02:18:30 [grizzly-http-server-15] [ERROR] o.a.h.c.GraphManager - Failed to create graph 'hugegraph2' due to: GraphFactory could not instantiate this Graph implementation [class org.apache.hugegraph.auth.HugeFactoryAuthProxy]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.apache.hugegraph.auth.HugeFactoryAuthProxy]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:84) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:72) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.hugegraph.core.GraphManager.createGraph(GraphManager.java:588) ~[hugegraph-api-1.5.0.jar:0.71.0.0]
        at org.apache.hugegraph.core.GraphManager.createGraph(GraphManager.java:188) ~[hugegraph-api-1.5.0.jar:0.71.0.0]
        at org.apache.hugegraph.api.profile.GraphsAPI.create(GraphsAPI.java:136) ~[hugegraph-api-1.5.0.jar:0.71.0.0]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ObjectOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:192) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) ~[jersey-common-3.0.3.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) ~[jersey-common-3.0.3.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[jersey-common-3.0.3.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[jersey-common-3.0.3.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244) ~[jersey-common-3.0.3.jar:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) ~[jersey-common-3.0.3.jar:?]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684) ~[jersey-server-3.0.3.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:356) ~[jersey-container-grizzly2-http-3.0.3.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:190) ~[grizzly-http-server-3.0.1.jar:3.0.1]
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535) ~[grizzly-framework-3.0.1.jar:3.0.1]
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515) ~[grizzly-framework-3.0.1.jar:3.0.1]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.reflect.InvocationTargetException
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:80) ~[gremlin-core-3.5.1.jar:3.5.1]
        ... 30 more
Caused by: org.apache.hugegraph.exception.ConnectionException: Failed to open RocksDB store
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.waitOpenFinished(RocksDBStore.java:261) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:249) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.tx.AbstractTransaction.<init>(AbstractTransaction.java:80) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.tx.IndexableTransaction.<init>(IndexableTransaction.java:28) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.tx.SchemaTransaction.<init>(SchemaTransaction.java:79) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.cache.CachedSchemaTransaction.<init>(CachedSchemaTransaction.java:54) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph.openSchemaTransaction(StandardHugeGraph.java:492) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph$TinkerPopTransaction.getOrNewTransaction(StandardHugeGraph.java:1512) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph$TinkerPopTransaction.doOpen(StandardHugeGraph.java:1421) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.open(AbstractTransaction.java:95) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$1.accept(Transaction.java:213) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$1.accept(Transaction.java:210) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractThreadLocalTransaction.doReadWrite(AbstractThreadLocalTransaction.java:92) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.readWrite(AbstractTransaction.java:136) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.hugegraph.StandardHugeGraph.graphTransaction(StandardHugeGraph.java:569) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph.backendStoreFeatures(StandardHugeGraph.java:287) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph.<init>(StandardHugeGraph.java:247) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.HugeFactory.open(HugeFactory.java:88) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.HugeFactory.open(HugeFactory.java:66) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.auth.HugeFactoryAuthProxy.open(HugeFactoryAuthProxy.java:87) ~[hugegraph-api-1.5.0.jar:1.5.0]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:80) ~[gremlin-core-3.5.1.jar:3.5.1]
        ... 30 more
Caused by: java.util.concurrent.ExecutionException: org.apache.hugegraph.exception.ConnectionException: Failed to open RocksDB 'rocksdb-data/data/hugegraph2/m'
        at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
        at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.waitOpenFinished(RocksDBStore.java:258) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:249) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.tx.AbstractTransaction.<init>(AbstractTransaction.java:80) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.tx.IndexableTransaction.<init>(IndexableTransaction.java:28) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.tx.SchemaTransaction.<init>(SchemaTransaction.java:79) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.cache.CachedSchemaTransaction.<init>(CachedSchemaTransaction.java:54) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph.openSchemaTransaction(StandardHugeGraph.java:492) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph$TinkerPopTransaction.getOrNewTransaction(StandardHugeGraph.java:1512) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph$TinkerPopTransaction.doOpen(StandardHugeGraph.java:1421) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.open(AbstractTransaction.java:95) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$1.accept(Transaction.java:213) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$1.accept(Transaction.java:210) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractThreadLocalTransaction.doReadWrite(AbstractThreadLocalTransaction.java:92) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.readWrite(AbstractTransaction.java:136) ~[gremlin-core-3.5.1.jar:3.5.1]
        at org.apache.hugegraph.StandardHugeGraph.graphTransaction(StandardHugeGraph.java:569) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph.backendStoreFeatures(StandardHugeGraph.java:287) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.StandardHugeGraph.<init>(StandardHugeGraph.java:247) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.HugeFactory.open(HugeFactory.java:88) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.HugeFactory.open(HugeFactory.java:66) ~[hugegraph-core-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.auth.HugeFactoryAuthProxy.open(HugeFactoryAuthProxy.java:87) ~[hugegraph-api-1.5.0.jar:1.5.0]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:80) ~[gremlin-core-3.5.1.jar:3.5.1]
        ... 30 more
Caused by: org.apache.hugegraph.exception.ConnectionException: Failed to open RocksDB 'rocksdb-data/data/hugegraph2/m'
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:359) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:304) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.lambda$open$3(RocksDBStore.java:227) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        ... 1 more
Caused by: org.rocksdb.RocksDBException: lock hold by current process, acquire time 1735092622 acquiring thread 140227226007296: rocksdb-data/data/hugegraph2/m/LOCK: No locks available
        at org.rocksdb.RocksDB.open(Native Method) ~[rocksdbjni-7.2.2.jar:?]
        at org.rocksdb.RocksDB.open(RocksDB.java:305) ~[rocksdbjni-7.2.2.jar:?]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStdSessions.openRocksDB(RocksDBStdSessions.java:413) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStdSessions.<init>(RocksDBStdSessions.java:102) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.openSessionPool(RocksDBStore.java:379) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:312) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.open(RocksDBStore.java:304) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at org.apache.hugegraph.backend.store.rocksdb.RocksDBStore.lambda$open$3(RocksDBStore.java:227) ~[hugegraph-rocksdb-1.5.0.jar:1.5.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        ... 1 more
Vertex/Edge example (问题点 / 边数据举例)

No response

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

No response

Dominant language
Java
Stars
3.2k
Forks
637
Avg merge
3d 18h
Merged PRs (30d)
23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/hugegraph

All issues in apache/hugegraph

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.