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

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   This is a well-identified issue in `TimelineRollService`. The fixed sleep + 
wide scan window design indeed causes:
   
   1. **Repeated rolling**: The scan window `[now + rollRange, now + rollRange 
+ timerMaxDelaySec]` is much wider than the sleep interval, so the same 
not-yet-expired timer message stays in range across multiple scans.
   2. **Non-monotonic progress**: In-memory-only progress means a broker 
restart can re-scan and re-roll the same delay-time range, causing duplicate 
deliveries.
   
   The proposed fix (persisted checkpoint + narrow scan windows) is sound. A 
few additional considerations:
   - The checkpoint write should be atomic (RocksDB single-key put is atomic, 
so this is fine).
   - The `1s early trigger` approach for the next due time is a good balance 
between latency and avoiding busy-wait.
   - Consider adding a metric for checkpoint advancement rate to detect stalls 
in production.
   
   An automated fix proposal may be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *Automated evaluation by github-manager*


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