Metastarx opened a new pull request, #11222: URL: https://github.com/apache/rocketmq/pull/11222
### Which Issue(s) This PR Fixes https://github.com/apache/rocketmq/issues/10850 - Fixes #10850 ### Brief Description ### Description Several mqadmin comparators subtract long values and cast the result to int. Consumer lag, tag counts, and message store timestamps can therefore be ordered incorrectly once their difference exceeds the int range. Affected commands include consumerProgress, printMessageByQueue, and queryMsgByUniqueKey. ### Expected behavior Use overflow-safe long comparison so command output remains correctly ordered for large values. ### How Did You Test This Change? PASSED: wsl -e bash scripts/gate-rocketmq.sh <details><summary>补充说明</summary> ## 背景 ### Description Several mqadmin comparators subtract long values and cast the result to int. Consumer lag, tag counts, and message store timestamps can therefore be ordered incorrectly once their difference exceeds the int range. Affected commands include consumerProgress, printMessageByQueue, and queryMsgByUniqueKey. ### Expected behavior Use overflow-safe long comparison so command output remains correctly ordered for large values. 相关 Issue:https://github.com/apache/rocketmq/issues/10850 ## 变更内容 ```diff .../consumer/ConsumerProgressSubCommand.java | 7 +- .../message/PrintMessageByQueueCommand.java | 6 +- .../message/QueryMsgByUniqueKeySubCommand.java | 13 ++- .../consumer/ConsumerProgressSubCommandTest.java | 97 ++++++++++++++++++++++ .../message/QueryMsgByUniqueKeySubCommandTest.java | 71 ++++++++++++++++ 5 files changed, 191 insertions(+), 3 deletions(-) tools/src/test/java/org/apache/rocketmq/tools/command/message/PrintMessageByQueueCommandTest.java | 110 +++++++++ ``` ## 验证 PASSED: wsl -e bash scripts/gate-rocketmq.sh ## 检查清单 - [ ] 未运行本地测试(以仓库 CI 为准) - [x] 变更最小且不包含无关文件 - [x] 已遵守仓库贡献规范 </details> -- 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]
