BILLYisavailable opened a new pull request, #11642:
URL: https://github.com/apache/rocketmq/pull/11642

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10863
   
   ### Brief Description
   
   Persist an empty checkpoint instead of leaving the previous entries on disk. 
A valid empty primary must also take precedence over an older backup; use file 
existence, rather than an empty result, to select the missing-file fallback.
   
   This affects `EpochFileCache`: truncating all entries produces an empty 
in-memory cache, but reopening the cache currently restores the old entries. 
The added regression reproduces `expected: 0, actual: 3` on unchanged `develop` 
at `19352a246`.
   
   This follows up on the closed, unmerged #10868 and #11032. The existing 
IOException fallback is retained.
   
   ### How Did You Test This Change?
   
   - Verified the empty-primary and truncate/reopen regressions fail before the 
fix.
   - All 6 `CheckpointFileTest` cases and 8 `EpochFileCacheTest` cases pass 
after the fix, including missing-primary, CRC mismatch, and entry-count 
corruption cases.
   - Checkstyle and SpotBugs pass in the same reactor build.
   
   ```sh
   mvn -pl store -am -Dtest=CheckpointFileTest,EpochFileCacheTest \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -Djacoco-maven-plugin.version=0.8.12 test
   ```
   
   Tested with JDK 17 and Maven 3.9.11. The command-line JaCoCo override avoids 
JDK 17 instrumentation errors from the default 0.8.5; the project POM is 
unchanged.
   


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

  • [PR] [ISSUE #10863] Persist emp... BILLYisavailable (via GitHub) via commits

Reply via email to