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

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10849
   
   ### Brief Description
   
   Static-topic epoch comparators in `TopicQueueMappingUtils` and 
`ClientMetadata` subtracted two `long` values and narrowed the result to `int`. 
Epoch deltas larger than `Integer.MAX_VALUE` could therefore reverse the 
intended newest-first order.
   
   This change uses `Long.compare` in both ordering paths. It adds regression 
coverage for replacement mode selecting the latest broker mapping across the 
full positive `long` range and for client endpoint construction retaining the 
latest broker.
   
   ### How Did You Test This Change?
   
   - Confirmed the new server-side regression test failed before the fix: 
expected `latest` but received `stale`.
   - Ran `mvn -pl remoting -am -DskipITs 
-Dtest=TopicQueueMappingUtilsTest,ClientMetadataTest 
-Dsurefire.failIfNoSpecifiedTests=false test`.
   - Result: 15 tests passed; Checkstyle reported 0 violations; SpotBugs 
reported no errors or warnings.


-- 
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