imbajin commented on code in PR #2888:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2888#discussion_r2462801272


##########
hugegraph-server/hugegraph-mysql/src/main/java/org/apache/hugegraph/backend/store/mysql/MysqlStore.java:
##########
@@ -223,6 +223,7 @@ public void truncate() {
         this.checkOpened();
 
         this.truncateTables();
+        this.init();

Review Comment:
   🧹 **Minor: Consider side effects of calling init()**
   
   The `init()` method does more than just `initTables()`:
   - It calls `checkClusterConnected()`
   - Creates database if not exists (`sessions.createDatabase()`)
   - Opens a new session
   - Then calls `checkOpened()` again
   
   **Observation:**
   Most of these operations are already done and may be redundant when called 
from `truncate()` (which already calls `checkOpened()` first).
   
   **Potential issue:**
   If there are any idempotency concerns with these operations being called 
multiple times, this could introduce subtle bugs.
   
   **Suggestion:**
   Review whether all operations in `init()` are safe to call multiple times 
during the store lifecycle, or extract just the table initialization logic into 
a separate method.



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