RockteMQ-AI commented on issue #10849:
URL: https://github.com/apache/rocketmq/issues/10849#issuecomment-5225268819

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The issue is valid. Static topic mapping sorts `long` epoch values by 
subtracting and narrowing to `int`. When two epochs differ by more than 
`Integer.MAX_VALUE`, the comparator reverses their order. In replacement mode, 
`checkAndBuildMappingItems` keeps the stale broker mapping instead of the 
latest.
   
   **Root Cause:** `(int)(a - b)` comparator pattern on `long` epoch values.
   **Impact:** Static topic — stale mapping can be selected, routing messages 
to wrong/outdated brokers.
   **Severity:** medium-high
   
   **Recommended fix:** Replace with `Long.compare(a, b)` for overflow-safe 
epoch ordering.
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*


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