apache / apache/rocketmq

[Bug] Lite topics created after broker startup are not delivered to wildcard subscribers until restart

Closed
#11,163 0 comments 0 reactions 0 assignees View on GitHub
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.
- [x] I have searched the GitHub Issues and Discussions and believe this is not a duplicate.
- [x] I have confirmed this bug belongs to the current repository.

### Runtime platform environment
OS: Linux / macOS

### RocketMQ version
branch: develop

### JDK Version
Compiler: Oracle JDK 11

### Describe the Bug
Since the lite topic prefix index was introduced (#10930), lite topics created after broker startup are never added to the index. Wildcard-subscription full dispatch and the parent-topic based operations (collect / count / clean lite topics) therefore miss every lite topic created at runtime, and only see the ones that existed at startup, until the broker restarts and repopulates the index.

Root cause: when the first message of a lite topic is written, the store notifies with logicOffset = queueOffset + 1, i.e. offset == 1 for the first message, but the dispatcher maintains the index only when offset == 0, so the create hook never fires at runtime.

### Steps to Reproduce
1. Start a broker with a LITE parent topic and a wildcard consumer group bound to it.
2. After startup, send the first message to a new lite topic under that parent.
3. The wildcard subscriber is not dispatched the new lite topic; admin operations that list/count/clean lite topics by parent topic also miss it.
4. Restart the broker; the lite topic now shows up.

### What Did You Expect to See?
A lite topic created at runtime is immediately visible to wildcard dispatch and to parent-topic collect/count/clean, without a restart.

### What Did You See Instead?
Runtime-created lite topics are missing until the broker restarts.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the lite topic prefix index through the store's first-message notification and the dispatcher logic that handles logicOffset values. Verify the runtime-created topic is indexed when its first message arrives, then confirm wildcard dispatch and parent-topic collect, count, and clean operations see it without a broker restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.