[ISSUE #11163] Fix lite topic prefix index not maintained on first message - #11164
Merged
Merged
Conversation
…rst message - Correct the off-by-one offset check in LiteEventDispatcher.dispatch (offset == 0 -> == 1) so onLmqCreate fires on the first arriving message - Restore store-dependent lifecycle tests to the concrete impl test classes, driven by real putMessage through the notify path - Add MessageArrivingListener overloads to LiteTestUtil to wire the real dispatch path in tests
RockteMQ-AI
reviewed
Sep 14, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Summary
This PR modifies 5 files (+209/-125) in apache/rocketmq.
Observations
- Diff size: 577 lines — moderate change, recommend careful review
- Test coverage: ✅ Test files included
Recommendations
- Please ensure backward compatibility if any public API is modified
- Verify thread safety for any concurrent code paths
- Confirm error handling is adequate for new code paths
Automated review by github-manager-bot
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11164 +/- ##
=============================================
- Coverage 49.42% 49.36% -0.07%
+ Complexity 14246 14227 -19
=============================================
Files 1390 1390
Lines 103132 103132
Branches 13485 13485
=============================================
- Hits 50969 50906 -63
- Misses 45997 46051 +54
- Partials 6166 6175 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
imzs
approved these changes
Sep 14, 2026
RockteMQ-AI
approved these changes
Sep 14, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
LGTM. The changes look good.
Automated review by github-manager-bot
lizhimins
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes
Brief Description
The lite topic prefix index is maintained only when the dispatcher sees offset == 0, but the message-arriving notification carries logicOffset = queueOffset + 1, so the first message of a lite topic arrives with offset == 1. The create hook thus never fires at runtime, and lite topics created after startup are missing from wildcard dispatch and parent-topic collect/count/clean until the broker restarts. This PR corrects the comparison to offset == 1 and restores the store-dependent lifecycle tests to the concrete impl test classes (file CQ and RocksDB CQ), driving the index through the real putMessage -> notify -> dispatch path so this behavior is covered.
How Did You Test This Change?
Unit tests in LiteLifecycleManagerTest (file CQ) and RocksDBLiteLifecycleManagerTest (RocksDB CQ) wire a real MessageArrivingListener + LiteEventDispatcher and assert collectByParentTopic / getLiteTopicCount / cleanByParentTopic against real putMessage. Before the fix they fail with an empty index; after the fix the lite test package passes (19 run, 0 failures). Checkstyle clean.