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

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The issue is valid. The comparator in `PopReviveService` subtracts two 
`long` revive offsets and casts to `int`, which can reverse ordering when 
offsets differ by more than `Integer.MAX_VALUE`. This causes `mergeAndRevive` 
to process checkpoints out of order.
   
   **Root Cause:** `Comparator` using `(int)(a - b)` pattern on `long` values 
instead of `Long.compare(a, b)`.
   **Impact:** Pop consumer — checkpoint revival order can be wrong, 
potentially causing message re-delivery or loss.
   **Severity:** medium
   
   **Recommended fix:** Replace the subtraction-based comparator with 
`Long.compare(offset1, offset2)`.
   
   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