bitflicker64 commented on code in PR #3237:
URL: https://github.com/apache/hugegraph/pull/3237#discussion_r4113857079


##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/core/GraphManager.java:
##########
@@ -2349,6 +2349,13 @@ public void dropGraph(String graphSpace, String name, 
boolean clear) {
             }
 
             g.clearBackend();
+            try {
+                // The schema version kept in PD for the schema cache sync
+                this.metaManager.deleteSchemaVersion(graphSpace, name);

Review Comment:
   Minor: The version key is deleted while the graph's reconciler is still 
scheduled. `SchemaVersionReconciler` is stopped only later, in `g.close()` via 
`stopReconciler()`. If any `bump()` during the drop failed (for example the one 
from `CachedSchemaTransactionV2.clear()` inside `clearBackend()`), 
`pendingWrite` is true, and a tick that runs between this delete and 
`g.close()` passes the `graphClosed` check and writes a fresh version at 
`SchemaVersionReconciler.run()` line 134. `stop()` uses `future.cancel(false)`, 
so a tick already running also completes its write. The key then outlives the 
graph. `StandardHugeGraph.drop()` (line 1172) has the same order: delete first, 
`close()` last. Please delete the key after the reconciler is stopped, for 
example by moving the delete after `g.close()` here and after `this.close()` in 
`drop()`, and extend `GraphManagerDropGraphTest` to cover a pending write at 
drop time.



-- 
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