Skip to content

[ISSUE #10849] fix(remoting): avoid static topic epoch sort overflow - #10854

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

[ISSUE #10849] fix(remoting): avoid static topic epoch sort overflow#10854
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-11

Conversation

@yuluo-yx

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

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

Replaces narrowing subtraction in both static-topic epoch comparators with Long.compare. Adds a regression test proving that replacement mode selects the mapping with the latest epoch across the full long range.

How Did You Test This Change?

mise x java@temurin-17 -- mvn -Dmaven.repo.local=/private/tmp/rocketmq-m2 -pl remoting -am -DskipITs -Dtest=TopicQueueMappingUtilsTest -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.29%. Comparing base (fd0c959) to head (09430c7).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10854      +/-   ##
=============================================
- Coverage      48.37%   48.29%   -0.08%     
+ Complexity     13555    13528      -27     
=============================================
  Files           1380     1380              
  Lines         101165   101165              
  Branches       13127    13127              
=============================================
- Hits           48940    48862      -78     
- Misses         46250    46309      +59     
- Partials        5975     5994      +19     

☔ 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. Overflow-safe comparator applied to both TopicQueueMappingUtils and ClientMetadata. Good coverage with tests for both locations.


Automated review by github-manager-bot

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.

Static topic mapping may select a stale epoch when the epoch delta overflows

3 participants