Skip to content

[ISSUE #10850] fix(tools): avoid overflow in mqadmin sorting - #10855

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-12
Open

[ISSUE #10850] fix(tools): avoid overflow in mqadmin sorting#10855
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-12

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 8, 2026

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

Uses overflow-safe long comparison for consumer lag, tag counts, and message store timestamps in mqadmin commands. Adds focused regression coverage for each comparator.

How Did You Test This Change?

mise x java@temurin-17 -- mvn -Dmaven.repo.local=/private/tmp/rocketmq-m2 -Djacoco.skip=true -pl tools -am -DskipITs -Dtest=GroupConsumeInfoTest,PrintMessageByQueueCommandTest,QueryMsgByUniqueKeySubCommandTest#testStoreTimestampComparatorWithoutOverflow -Dsurefire.failIfNoSpecifiedTests=false test

The targeted tests, Checkstyle, and SpotBugs completed successfully.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.32%. Comparing base (fd0c959) to head (a936f13).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10855      +/-   ##
=============================================
- Coverage      48.37%   48.32%   -0.06%     
+ Complexity     13555    13533      -22     
=============================================
  Files           1380     1380              
  Lines         101165   101167       +2     
  Branches       13127    13127              
=============================================
- Hits           48940    48887      -53     
- Misses         46250    46291      +41     
- Partials        5975     5989      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Same overflow-safe pattern applied correctly to MQAdminUtils. Test covers the Long.MAX_VALUE / Long.MIN_VALUE boundary case.


Automated review by github-manager-bot

@yuluo-yx

yuluo-yx commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

I confirmed the CI failure is not caused by this PR. Please rerun CI, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mqadmin commands misorder large counters and timestamps

3 participants