ai-yang opened a new pull request, #10758: URL: https://github.com/apache/rocketmq/pull/10758
### Which Issue(s) This PR Fixes Fixes #10755 ### Brief Description `ConsumeQueue.truncateDirtyLogicFiles()` truncated the main consume queue but did not trim `ConsumeQueueExt` to the last retained extension address. Ext units from the discarded CQ tail therefore remained readable, and later appends plus reload/recovery could preserve those orphaned units permanently. This change aligns CQExt truncation with the successfully retained CQ state: - normal truncation exits locate the last readable retained Ext reference after `minLogicOffset` and truncate to it; - when no Ext reference is retained, all Ext mapped files are removed and the address cursor is reset only after deletion succeeds; - partial mapped-file deletion enters a pending state that blocks address reuse until cleanup is retried successfully; - CQ physical-delete failures and `deleteFile=false` do not mutate CQExt independently; - recovery of an empty CQ cleans up orphaned Ext files left by an interrupted truncation. ### How Did You Test This Change? - Unmodified `develop`: the deterministic truncate/reload regression failed in 5/5 isolated JDK 8 Maven processes. - Fixed targeted suite: 20 isolated Maven/JVM processes at 9/9 each (180/180 total), covering partial truncation, reload, full clear, failed deletion/retry, address reuse, `minLogicOffset`, and recovery. - Full `store -am test`: common 241/241, remoting 174/174, and store 322 tests with 4 skips, 0 failures, and 0 errors. - Maven validate and Checkstyle: 0 violations. - SpotBugs: 0 bugs/errors across all four reactor modules. - `git diff --check`: passed. -- 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]
