[Bug] Missing long-polling notification under CombineConsumeQueue selective double-write mode
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
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
.
### RocketMQ version
.
### JDK Version
.
### Describe the Bug
ReputMessageService#doReput() decides whether to notify long-polling consumers right after dispatching a message to the consume queue.
Previously this decision was driven by a boolean field (notifyMessageArriveInBatch) in DefaultMessageStore, which was flipped to true as a side effect inside the RocksDBConsumeQueueStore. The rationale is correct for a pure RocksDB CQ: the RocksDB consume queue is built asynchronously by RocksGroupCommitService, which performs the notification itself once the CQ is committed, so reput-time notification would wake consumers before the message is visible, so we must skip it.
However, CombineConsumeQueueStore also instantiates an inner RocksDBConsumeQueueStore (when combineCQLoadingCQTypes contains DEFAULT_ROCKSDB). Because the flag lives in the shared DefaultMessageStore, this constructor disables reput-time notification for the entire store — even when selective double-write (rocksdbCQSelectiveDoubleWriteEnable=true) is enabled.
Under selective double-write, RocksDB CQ is only double-written for a subset of topics. As a result: Topics that are not double-written to RocksDB never go through the RocksGroupCommitService notification path. These consumers are therefore only woken up by the long-polling timeout, adding consume latency.
### Steps to Reproduce
.
### What Did You Expect to See?
.
### What Did You See Instead?
.
### Additional Context
_No response_
Contributor guide
Research direction
Start by reading ReputMessageService#doReput() and the notifyMessageArriveInBatch field in DefaultMessageStore, then trace how CombineConsumeQueueStore and its inner RocksDBConsumeQueueStore handle selective double-write. Run or add a focused reproduction with rocksdbCQSelectiveDoubleWriteEnable=true; done means non-double-written topics receive immediate long-polling notifications without breaking pure RocksDB CQ behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100