zmuxuny opened a new pull request, #11213: URL: https://github.com/apache/rocketmq/pull/11213
### Which Issue(s) This PR Fixes - Fixes #11212 ### Brief Description During POP cache cleanup, an expired checkpoint moves from `recordTreeMap` to `removeTreeMap` before it is revived or persisted. Both maps can contain checkpoints at once. `getMinOffsetInBuffer()` previously returned the first staged offset whenever the staged map was nonempty, even if an earlier offset remained only in memory in the active map. The method now returns the minimum across both maps. It reads the active map first, matching the cleanup transfer order (put into staged, then remove from active), so an offset being transferred cannot disappear between the two reads. This protects the minimum exposed by `getMinOffsetInCache()` to the POP commit path. It does not alter POP retry, ACK, or storage behavior. The focused regression creates active offset 100 and staged offset 200. It failed on `develop` with `expected 100 but was 200`, then passed with the fix. It also verifies the staged-only and empty-cache boundaries. #10964 is related offset-convergence work that also relies on this minimum; this PR addresses the helper's incorrect mixed-map result. ### How Did You Test This Change? - `JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 mvn -B -ntp -pl broker -am -Dtest=PopConsumerCacheTest -Dsurefire.failIfNoSpecifiedTests=false test` — reactor build passed; 4 `PopConsumerCacheTest` cases passed; JaCoCo report generated. - The same focused reactor test also passed on JDK 21 with `-Djacoco.skip=true` (the repository's JaCoCo 0.8.5 agent does not support JDK 21 instrumentation). - `git diff --check` — passed. I also tried direct `checkstyle:check`; it stops in the unchanged `rocketmq-common` module on 8,244 existing violations, before checking `broker`. -- 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]
