imbajin commented on code in PR #2888:
URL:
https://github.com/apache/incubator-hugegraph/pull/2888#discussion_r2462800366
##########
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:
‼️ **Critical: Missing test coverage for the fix**
This fix addresses a critical bug where the meta table gets cleared during
graph truncation, but there's no test to verify the fix works correctly or
prevent regression.
**Suggested action:**
Add a test that:
1. Verifies the meta table is properly initialized after truncate()
2. Checks that the backend version is still readable after truncation
3. Ensures other metadata persists correctly
Example test structure:
```java
@Test
public void testTruncatePreservesMetaTable() {
// Write version to meta table
store.init();
String versionBefore = sessions.systemStore().storedVersion();
// Truncate should not lose meta table
store.truncate();
String versionAfter = sessions.systemStore().storedVersion();
Assert.assertEquals(versionBefore, versionAfter);
}
```
--
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]