Skip to content

[ISSUE #10529] Incorrect queue permissions in gRPC QueryRouteResponse when read/write queue counts differ#10530

Open
Kris20030907 wants to merge 1 commit into
apache:developfrom
Kris20030907:fix-proxy-permissions
Open

[ISSUE #10529] Incorrect queue permissions in gRPC QueryRouteResponse when read/write queue counts differ#10530
Kris20030907 wants to merge 1 commit into
apache:developfrom
Kris20030907:fix-proxy-permissions

Conversation

@Kris20030907

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

How Did You Test This Change?

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 get READ, queues only in write range get WRITE. 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 to NONE, 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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.09%. Comparing base (f941dce) to head (285aab1).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect queue permissions in gRPC QueryRouteResponse when read/write queue counts differ

3 participants