You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "iloveeyjafjalla (via GitHub)" <gi...@apache.org> on 2026/10/16 05:35:13 UTC
[PR] fix(acl): scope the broker push to the instance's cluster [rocketmq-dashboard]
iloveeyjafjalla opened a new pull request, #6851:
URL: https://github.com/apache/rocketmq-dashboard/pull/6851
Fixes #6850
## The defect
`pushAclToBroker` resolved its broker list from the entire `brokerAddrTable` of the instance endpoint, while the rules view of the same page narrows that topology to the instance's configured cluster (#6502). On a NameServer shared by several clusters the push therefore installed every stored account and policy on the *other* cluster's brokers, and reported those upserts as successes in `PushAclToBrokerResultVO` and in the `PUSH_ACL_TO_BROKER` audit record. The pre-flight ACL 2.0 switch check read `getBrokerConfig` of an arbitrary broker from that unscoped list as well.
## The fix
The scope now lives in one place, `AclBrokerScope.scopedBrokerNames(clusterInfo, configuredCluster)`, and both ACL paths resolve their broker set through it — the read keeps its behaviour and the push gains it, so they can no longer disagree. The helper carries the rule unchanged: an instance that names no cluster keeps every broker of the endpoint, and an unresolvable cluster membership fails closed with a 503 rather than falling back to the whole cluster table (the state `RocketMQClusterProvider.discoverBrokers` reports the same way).
`AclService.masterAddresses(adminExt, instanceId)` now narrows first and maps the surviving broker names to their master addresses. Because the names come from a `TreeSet`, the push's broker order is the cluster's name order instead of a hash-table order, which makes the broker the pre-flight check runs against deterministic.
## Tests
`AclServiceTest.pushAclToBrokerTouchesOnlyTheConfiguredClusterOfASharedNameServerTest` — a two-cluster topology on one endpoint, instance bound to `cluster-a`:
```
expected: ["10.0.0.1:10911"]
but was: ["10.0.0.1:10911", "10.0.0.2:10911"]
```
It also asserts that no `createUser`, `updateUser`, `updateAcl` or `getBrokerConfig` call reaches `10.0.0.2:10911`. `pushAclToBrokerKeepsEveryMasterWhenTheInstanceNamesNoClusterTest` pins the unchanged behaviour for an instance without a configured cluster.
```
[INFO] Tests run: 85, Failures: 0, Errors: 0 -- AclServiceTest
[INFO] Tests run: 27, Failures: 0, Errors: 0 -- AclControllerTest
[INFO] Tests run: 6, Failures: 0, Errors: 0 -- ApacheAclReadServiceTest
[INFO] You have 0 Checkstyle violations.
```
The read side is untouched behaviourally: `ApacheAclReadServiceTest` (including its `sharedTopology` scoping cases and the 503 case) passes unchanged after the helper moved out of the service.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(acl): scope the broker push to the instance's cluster [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #6851:
URL: https://github.com/apache/rocketmq-dashboard/pull/6851
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(acl): scope the broker push to the instance's cluster [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #6851:
URL: https://github.com/apache/rocketmq-dashboard/pull/6851#issuecomment-6441500653
Merged into `rocketmq-studio` as `da2513c9f`.
This PR carried the whole batch: we consolidated 11 of your related fixes (#6851, #6189, #6203, #6267, #6297, #6321, #6352, #6668, #6845, #6865, #7033) into a single commit rather than landing 11 near-identical ones on the trunk. Every change was cherry-picked onto the current baseline with you kept as the author, and your tests came along with it. The commit body describes each part and says explicitly which lines we added while landing the batch.
Verified on the combined branch before merging: 4143 backend tests, 2009 frontend tests across 166 files, the license gate 8/8, the production build, eslint with no new warnings against the trunk baseline, and `make catalog-verify` / `go test` / `go vet` / `make fmt` all clean. CI on the PR itself was 5/5 green.
The other 10 PRs are closed with a note pointing here. Thanks for the consistently well-tested patches - the mutation-sensitive tests made several of these easy to land.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org