[ISSUE #10529] Incorrect queue permissions in gRPC QueryRouteResponse when read/write queue counts differ#10530
Open
Kris20030907 wants to merge 1 commit into
Open
Conversation
RockteMQ-AI
approved these changes
Jun 18, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Fixes incorrect queue permission assignment in RouteActivity.genMessageQueueFromQueueData() when read/write queue counts differ. The old code assigned queue IDs sequentially by permission type (all READ first, then WRITE, then READ_WRITE), which did not match the broker-side behavior where queue 0..min(r,w)-1 should be READ_WRITE.
Findings
- [Positive] The new logic correctly assigns permissions based on queue ID position: queues within both read and write ranges get
READ_WRITE, queues only in read range getREAD, queues only in write range getWRITE. This matches the actual broker-side queue permission model. - [Positive] Edge case for inaccessible permissions is preserved —
queueNums = max(1, max(read, write))with all queues set toNONE, identical to the old behavior. - [Positive] Code is significantly simplified: from ~50 lines with 4 separate loops down to ~30 lines with a single loop. Much more readable and maintainable.
- [Positive] Tests are well-structured — the new test cases cover asymmetric read/write scenarios (4R/8W and 8R/4W), and the existing test now also validates queue ID assignments.
Verdict
Clean bug fix with correct logic and good test coverage. LGTM.
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 #10530 +/- ##
=============================================
- Coverage 48.19% 48.09% -0.10%
+ Complexity 13401 13375 -26
=============================================
Files 1377 1377
Lines 100753 100735 -18
Branches 13019 13020 +1
=============================================
- Hits 48555 48448 -107
- Misses 46259 46332 +73
- Partials 5939 5955 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
How Did You Test This Change?