[ISSUE #10768] Continue queryRoute after missing broker data - #10769
[ISSUE #10768] Continue queryRoute after missing broker data#10769Aias00 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes Proxy gRPC route discovery so RouteActivity#queryRoute continues iterating through all QueueData entries even when a queue row references a broker name that’s missing from the built broker map, preventing later valid queues from being omitted.
Changes:
- Change
queryRoutebehavior on missing broker mapping frombreaktocontinueso only the malformed queue row is skipped. - Add a regression test covering “missing broker queue row before valid queue row” to ensure valid queues still appear in the response.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/route/RouteActivity.java | Fixes route-building loop to skip only malformed queue rows with missing broker mappings. |
| proxy/src/test/java/org/apache/rocketmq/proxy/grpc/v2/route/RouteActivityTest.java | Adds a regression test ensuring later valid queues are still returned after a missing-broker queue row. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
One-line fix: changes to in when a entry references a broker name absent from the built broker map. Previously, a single stale/malformed queue row would truncate the entire route response by breaking out of the loop.
Findings
- [Correctness] — The fix is correct. A missing broker mapping should not prevent processing of subsequent valid entries. The previous behavior could silently drop valid routes from the response.
- [Tests] — Good test coverage. verifies that a missing broker in the middle of the queue data list does not prevent later valid entries from being included in the response.
Verdict
Clean, minimal fix with appropriate 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 #10769 +/- ##
=============================================
+ Coverage 48.24% 48.26% +0.02%
- Complexity 13496 13497 +1
=============================================
Files 1380 1380
Lines 101104 101104
Branches 13107 13107
=============================================
+ Hits 48773 48794 +21
+ Misses 46350 46334 -16
+ Partials 5981 5976 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What changed
This PR makes Proxy gRPC
RouteActivity#queryRouteskip only the malformed queue row when its broker name is absent from the built broker map.Previously the loop used
break, so one stale/malformedQueueDataentry could stop processing later valid queue rows and truncate the route response.Why
A missing broker mapping should not hide valid queue routes that appear later in the same route data. This can affect gRPC route discovery when route metadata contains stale queue data.
Fixes #10768.
Verification
mvn -pl proxy -Dtest=RouteActivityTest testResult: BUILD SUCCESS.
RouteActivityTestran 8 tests with 0 failures/errors/skips. Checkstyle and SpotBugs also passed in the Maven run.