beautyarbutin opened a new pull request, #11198: URL: https://github.com/apache/rocketmq/pull/11198
### Which Issue(s) This PR Fixes - Fixes #10852 ### Brief Description `ConsumeReviveObj.genSortList()` previously ordered revive offsets by subtracting two `long` values and narrowing the result to `int`. When the offset gap exceeded the integer range, the narrowing conversion could reverse the comparison result and process revive checkpoints out of order. This change uses `Long.compare` so the full offset range is ordered correctly. It also adds a deterministic regression test with an offset gap just beyond `Integer.MAX_VALUE`. This reimplements the fix from the earlier, closed PR #10857 against the current `develop` branch. Thanks to @yuluo-yx for the original report and patch. ### How Did You Test This Change? - `mvn -B -ntp -pl broker -DskipITs -Dtest=PopReviveServiceTest test` - Result: 13 tests passed, with no failures or errors. - Checkstyle: 0 violations. - SpotBugs: 0 bugs and 0 errors. -- 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]
