Frun1na opened a new pull request, #6529: URL: https://github.com/apache/rocketmq-dashboard/pull/6529
### Which Issue(s) This PR Fixes - Fixes #6528 ### Brief Description `786a308e` (#6196) applied the configured cluster to `refreshClusterDetail` and `discoverBrokers` and listed the readers still seeing the whole cluster table; the dashboard provider was one of them. `RocketMQDashboardProvider.getDashboardData(String):185-192` aggregated every cluster of a shared NameServer, so an instance configured for cluster A summed cluster B's brokers, topics, consumer groups, TPS and daily messages into its overview and per-cluster rows (`collectDashboardData:214-219` built the master list from the whole `brokerAddrTable`), while the cluster and broker pages of the same instance correctly showed only A. `getDashboardData(String)` now resolves `configuredClusterName(instanceId)` and `scopeClusterTable`/`scopeBrokerTable` narrow both topology tables to that cluster before anything is counted, following the pattern already used by `discoverClusters`/`discoverBrokers`; the configured cluster keeps its (possibly empty) entry so a cluster missing from the topology degrades to a warning row, matching the aggregate dashboard's unreachable-instance rows. User-visible change: a default-cluster instance's dashboard now reports only its own cluster's brokers/topics/groups/TPS; registered instances and the legacy Nameserver entry point are unchanged. This is the third of the three spots the merged commit named (`ApacheAclReadService` was covered by #6502; the metrics collector was verified unreachable). ### How Did You Test This Change? ``` cd server mvn -B -ntp test -DforkCount=1 -Dtest=RocketMQDashboardProviderTest [INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0 -- in ...RocketMQDashboardProviderTest [INFO] You have 0 Checkstyle violations. ``` The new test fails without the fix: ``` [ERROR] Tests run: 32, Failures: 1, Errors: 0, Skipped: 0 ...dashboardShouldNarrowTheTopologyToTheClusterConfiguredForTheInstanceTest -- FAILURE! java.lang.AssertionError: Expected size: 1 but was: 2 in: [ClusterOverviewVO(id=cluster-a, ...), ClusterOverviewVO(id=cluster-b, ...)] ``` `dashboardShouldExposeEveryClusterForAnInstanceWithoutAConfiguredClusterTest` is the control that fails if the restriction is widened past instance scope. Reverting only the two narrowing calls (keeping the tests) reproduces exactly the failure above. ### 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]
