imbajin commented on code in PR #2888:
URL:
https://github.com/apache/incubator-hugegraph/pull/2888#discussion_r2462801047
##########
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:
⚠️ **Important: Check consistency with other backend stores**
The PR description mentions that "HugeGraph only supports hstore, rocksdb,
hbase, and memory" but this fix is only applied to MySQL backend.
**Questions to verify:**
1. Do RocksDB, HBase, and Memory backends have the same issue?
2. From my quick check, HBase's `truncate()` method doesn't call `init()`
after truncating tables - why is MySQL different?
3. Is there a fundamental difference in how MySQL handles the meta table vs
other backends?
**Recommendation:**
- Document WHY MySQL requires this init() call while other backends don't
- Verify other supported backends (RocksDB, HBase) don't have similar issues
- Consider adding a comment explaining the MySQL-specific requirement:
```java
this.truncateTables();
// MySQL-specific: Re-initialize tables to restore meta table
// Other backends handle meta table separately during truncation
this.init();
```
--
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]