chenxu80 opened a new issue, #10417:
URL: https://github.com/apache/rocketmq/issues/10417

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [x] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [x] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   ubuntu 24.04
   
   ### RocketMQ version
   
   rocketmq-all-5.5.0
   
   ### JDK Version
   
   JDK 8u202
   
   ### Describe the Bug
   
   When broker-side commitlog truncation removes all ConsumeQueue files for a 
topic queue, the queue may retain a stale minOffset instead of resetting it to 
0, leaving an inconsistent state where minOffset > maxOffset (with maxOffset == 
0).
   
   ### Steps to Reproduce
   
   - Enable Jraft controller mode
   - Make a broker-slave offline
   - Produce some messages to a never-used topic queue on broker-master
   - Make the master offline
   - Make the slave online and let controller choose it as new master(if the 
slave was out of ISR, enable electUncleanMaster)
   - Produce more messages to the topic queue mentioned above
   
   ### What Did You Expect to See?
   
   Messages produced to the topic queue can be consumed
   
   ### What Did You See Instead?
   
   Messages produced to the topic queue cannot be consumed until enough 
messages had been written into the queue(which will make the stale minOffset 
effective again)
   
   ### Additional Context
   
   This problem is caused by method: 
   
   org.apache.rocketmq.store.ConsumeQueue#correctMinOffset
   
   when 'minLogicOffset >= mappedFileQueue.getMaxOffset()' is satisfied, this 
method did nothing and just return


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