The broker restart caused messages backlog and they couldn't be consumed
- 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
4.19.90-23-42.v2101.ky10.x86_64
### RocketMQ version
5.2.0
### JDK Version
openjdk 1.8
### Describe the Bug
There is a problem with the queue allocation of consumer instances on the broker. After a certain broker was restarted, the queues of topic "XXX" on this machine were not allocated to any consumers.
1. broker-a has gone down and the routing data has changed. The consumers update the message queue for the assigned topic and remove the queue of broker-a.
2. broker-a is unavailable. At this point, the message queue to which the topic was assigned does not contain the queue for broker-a.
3. consumer unscribe the topic "XXX"
4. broker-a is available and the routing data has changed. The consumer updates the assigned message queue and adds the queue of broker-a.
5. the consumer has unsubscribed from the topic, so the ‘topicSubscribeInfoTable’ will not be updated, and the queue of broker-a will not be added to the message queue corresponding to the topic "XXX". his update will only be carried out once, unless the 'topicRouteData' changes.
6. the consumer scribe the topic "XXX", the 'topicSubscribeInfoTable' in the table is outdated and cannot be updated actively.
### Steps to Reproduce
1.shutdown broker-a
2.the consumer unscribe the topic "XXX"
3.restart broker-a
4.the consumer scribe the topic "XXX"
### What Did You Expect to See?
the queue of topic "XXX" on broker-a has no assigned consumers.
### What Did You See Instead?
The queues of "XXX" on broker-a have been correctly assigned consumers for consumption.
### Additional Context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.