github-actions[bot] commented on code in PR #65201:
URL: https://github.com/apache/doris/pull/65201#discussion_r3551733390
##########
regression-test/suites/demo_p0/test_lru_persist.groovy:
##########
@@ -79,20 +79,33 @@ suite('test_lru_persist', 'docker') {
sleep(15000);
cluster.stopBackends(1)
- def normalBefore = "md5sum
${cachePath}/lru_dump_normal.tail".execute().text.trim().split()[0]
- logger.info("normalBefore: ${normalBefore}")
+ def normalDumpBeforeRestart = new
File("${cachePath}/lru_dump_normal.tail")
+ assert normalDumpBeforeRestart.exists()
+ assert normalDumpBeforeRestart.length() > 0
+ def normalDumpLastModifiedBeforeRestart =
normalDumpBeforeRestart.lastModified()
+ logger.info("normal dump before restart size:
${normalDumpBeforeRestart.length()}, "
+ + "last modified: ${normalDumpLastModifiedBeforeRestart}")
cluster.startBackends(1)
sleep(10000);
- cluster.stopBackends(1)
+ def show_backend_after_restart = sql '''show backends'''
+ logger.info("Backend details after restart:
${show_backend_after_restart.toString()}")
+ assert show_backend_after_restart[0][9].toString() == "true"
+
+ def count_after_restart = sql '''select count(*) from tb1'''
+ assert count_after_restart[0][0] == 12
- // check md5sum again after be restart
- def normalAfter = "md5sum
${cachePath}/lru_dump_normal.tail".execute().text.trim().split()[0]
- logger.info("normalAfter: ${normalAfter}")
+ cluster.stopBackends(1)
- sql '''show data'''
- assert normalBefore == normalAfter
+ // The dump file may be rewritten during restart by
restore/replay/dump background tasks.
+ // Verify the new dump is generated instead of requiring byte-for-byte
equality.
+ def normalDump = new File("${cachePath}/lru_dump_normal.tail")
+ logger.info("normal dump after restart exists: ${normalDump.exists()},
size: ${normalDump.length()}, "
+ + "last modified: ${normalDump.lastModified()}")
+ assert normalDump.exists()
+ assert normalDump.length() > 0
+ assert normalDump.lastModified() > normalDumpLastModifiedBeforeRestart
Review Comment:
This weakens the regression from checking the persisted LRU content to
checking only that a dump file exists and was rewritten. A broken restore path
that drops or regenerates the normal LRU queue could still leave a non-empty
`lru_dump_normal.tail` with a newer mtime, and the `select count(*)` above only
proves table data is readable, not that the pre-restart LRU state was restored.
Could we keep a semantic persistence check here, for example by
parsing/normalizing the dump entries or asserting a restored cache/LRU state,
instead of relying on timestamp advancement?
--
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]