imbajin commented on code in PR #3141:
URL: https://github.com/apache/hugegraph/pull/3141#discussion_r3740943922


##########
hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreSessionsImpl.java:
##########
@@ -181,20 +195,27 @@ public void truncateTable(String table) {
     public void clear() {
         this.session.deleteGraph();
         try {
-            hgStoreClient.getPdClient().delGraph(this.graphName);
+            this.graphStoreClient.delGraph(this.graphName);
         } catch (PDException ignored) {
 
+        } finally {
+            clearInitializedGraph(this.graphName);

Review Comment:
   ⚠️ The production-level clear/reopen path is still untested and can leave 
the graph unregistered. `HstoreStore.open()` returns through 
`sessions.useSession()` when its session pool is still open, while 
`BackendSessionPool.useSession()` only reattaches/detects the existing session 
and never calls `HstoreSessionsImpl.open()` or `setGraph()`. Thus `clear(true)` 
followed by `store.open(config)` can delete the PD graph and then skip 
recreating it; the new test calls `HstoreSessionsImpl.open()` directly and does 
not cover this path. Please make the store-level reopen re-register the graph 
and add a `HstoreStore` clear → open regression test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to