Frun1na opened a new pull request, #6502:
URL: https://github.com/apache/rocketmq-dashboard/pull/6502

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6501
   
   ### Brief Description
   
   #6196 narrowed `RocketMQClusterProvider`'s three instance-scoped topology 
reads
   (`discoverClusters`, `refreshClusterDetail`, `discoverBrokers`) to the 
cluster configured for the instance, and its
   message names `ApacheAclReadService` as one of the readers that still saw 
the whole cluster table.
   `listRules` 
(`server/src/main/java/org/apache/rocketmq/studio/instance/acl/ApacheAclReadService.java:37`)
 walked
   every entry of the shared `brokerAddrTable`, so on an instance configured 
for cluster A whose NameServer also
   serves cluster B, `GET /api/acl/remote/rules?instanceId=…` returned cluster 
B's brokers in `policiesByBroker` and
   `failuresByBroker` — a remote-rule view of the selected instance that mixed 
in another cluster.
   
   The broker set is now resolved through the same 
`runtimeAdminClientResolver.configuredClusterName(instanceId)`
   lookup the cluster provider uses, and only the members of that cluster are 
read. A configured cluster whose
   membership is missing from the topology is reported as `503 Broker cluster 
membership is unavailable` instead of
   falling back to the whole table — the same condition and status 
`discoverBrokers` raises (see
   `RocketMQClusterProvider.discoverBrokers`). An instance that names no 
cluster keeps reading every broker of the
   endpoint, and the per-broker success/failure collection is unchanged.
   
   User-visible change: the remote ACL rules of an instance configured for one 
cluster no longer include brokers of
   another cluster behind the same NameServer; a configured cluster that the 
topology cannot resolve now answers
   `503` instead of silently reading every broker.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test -DforkCount=1 
-Dsurefire.failIfNoSpecifiedTests=false -Dtest=ApacheAclReadServiceTest
   [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.874 
s -- in ApacheAclReadServiceTest
   [INFO] BUILD SUCCESS
   ```
   
   `readsRemoteRulesOnlyFromTheConfiguredClusterTest` asserts the scoped 
broker's rules and that
   `listAcl("10.0.0.12:10911", …)` is never called; 
`reportsUnavailableClusterMembershipInsteadOfEveryBrokerTest`
   asserts the 503; 
`readsRemoteRulesFromEveryBrokerWhenTheInstanceNamesNoClusterTest` is the 
control that keeps an
   unscoped instance on the full broker table.
   
   The new tests fail without the fix — only the broker-set resolution reverted 
to the previous whole-table walk,
   the tests kept:
   
   ```
   [ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0
   ApacheAclReadServiceTest.readsRemoteRulesOnlyFromTheConfiguredClusterTest -- 
<<< FAILURE!
   java.lang.AssertionError:
   Expecting actual:
     {"10.0.0.11:10911"=[], "10.0.0.12:10911"=[]}
   to contain only following keys:
     ["10.0.0.11:10911"]
   keys not found:
     []
   and keys not expected:
     ["10.0.0.12:10911"]
   
   
ApacheAclReadServiceTest.reportsUnavailableClusterMembershipInsteadOfEveryBrokerTest
 -- <<< FAILURE!
   java.lang.AssertionError:
   Expecting code to raise a throwable.
   ```
   
   (The control case passes in both runs, so the assertions fail on the cluster 
filter and on the missing error path,
   not on the test fixtures.)
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to