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

   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and 
[link this pull request to that issue using 
keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>)
 to ensure automatic closure. -->
   
   - Fixes #10417
   
   ## Summary
     - fix a case where broker-side commitlog truncation removes all 
ConsumeQueue files for a topic queue but leaves a stale
     `minOffset`
     - reset the queue's logical minimum offset when the queue becomes empty, 
so `minOffset` stays consistent with `maxOffset`
     - avoid exposing an invalid state where `maxOffset == 0` but `minOffset > 
0`
   
     ## Root cause
     When all ConsumeQueue files of a topic queue are deleted during commitlog 
truncation, the in-memory logical minimum offset may
      not be reset. As a result, later `minOffset` queries can return a stale 
value even though the queue is already empty.
   
     ## Test Plan
     - reproduce the scenario where commitlog truncation removes all 
ConsumeQueue files for a topic queue
     - verify the queue reports `minOffset == 0` and `maxOffset == 0` after 
truncation
     - run the related store tests
   


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