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

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10850
   
   ### Brief Description
   
   Several mqadmin comparators subtract `long` values and narrow the result to 
`int`, which can reverse the intended ordering when the difference exceeds the 
integer range.
   
   This change uses overflow-safe comparison for:
   
   - consumer lag in `consumerProgress` (descending)
   - tag counts in `printMessageByQueue` (descending)
   - message store timestamps in `queryMsgByUniqueKey` (ascending)
   
   The timestamp comparator is named so its boundary behavior can be tested 
directly.
   
   This reimplements the fix from the earlier, closed PR #10855 against the 
current `develop` branch. Thanks to @yuluo-yx for the original report and patch.
   
   ### How Did You Test This Change?
   
   - Red-first regression: `GroupConsumeInfoTest` failed on the original 
subtraction-based comparator with `Long.MAX_VALUE` and `0`.
   - Focused comparator tests: 3 passed, 0 failures/errors/skips.
   - Full tools module: `mvn -B -ntp -pl tools test`
   - Full module result: 154 tests run, 0 failures, 0 errors, 5 existing skips.
   - 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]

Reply via email to