[Bug] consumequeue correctMinOffset throws IllegalArgumentException causing startup failure
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 26
Description
### 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
centos7
### RocketMQ version
rocketmq-all-5.3.3 [Latest](https://github.com/apache/rocketmq/releases/latest) and develop
### JDK Version
JDK 1.8
### Describe the Bug
### Steps to Reproduce
1. the last mappfile in the A consumequeue is empty (this is possible because of asynchronous refresh)
2. commitlog is configured with async-flush and sync-master, commitlog messages which build A consumequeue lost during restart
3. broker restart will not truncate(truncateDirtyLogicFiles) the last empty A consuequeue mappflile
4. correctMinOffset in recoverTopicQueueTable will throw IllegalArgumentException and restart failed
### What Did You Expect to See?
An empty consumequeue will not cause broker restart failure
### What Did You See Instead?
broker restart failure
### Additional Context
_No response_
Contributor guide
Research direction
Start by tracing recoverTopicQueueTable and its correctMinOffset call, then inspect truncateDirtyLogicFiles and the consumequeue recovery path described in the reproduction. Reproduce the empty final consumequeue mappfile scenario with the stated async-flush and sync-master settings; done means broker restart no longer fails when that file is empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems, stream-processing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100