RockteMQ-AI commented on issue #4549:
URL: 
https://github.com/apache/rocketmq-dashboard/issues/4549#issuecomment-5727166963

   **Issue Evaluation — Correction**
   
   Category: `bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase (commit 
`d50ffecc9d`).
   
   **Root Cause:**
   In `MetadataService.listTopicsPage()` (line ~100) and 
`MetadataService.listConsumerGroupsPage()` (line ~218), when `instanceId` is 
present, the code delegates to `InstanceProvider.listTopicsPage(instanceId, 
type, search, page, pageSize)` — but the `InstanceProvider` interface does not 
accept a `clusterId` parameter at all. The `clusterId` argument received by 
`MetadataService` is silently discarded on the instance-scoped pagination path.
   
   The non-paginated `listTopics()` and `listConsumerGroups()` methods have the 
same structural issue but are less affected because they return unfiltered 
lists that the frontend may paginate client-side.
   
   **Impact:**
   - When one Studio instance aggregates metadata from multiple RocketMQ 
clusters, paginated Topic and Consumer Group listings return resources from 
**all** clusters under the instance, ignoring the `clusterId` filter.
   - The pagination `total` count is also incorrect for the requested cluster 
scope.
   - This is a data correctness issue in multi-cluster deployments.
   
   **Severity:** Medium — affects multi-cluster Studio deployments; 
single-cluster users are unaffected.
   
   **Suggested Fix Direction:**
   1. Add `clusterId` parameter to `InstanceProvider.listTopicsPage()` and 
`InstanceProvider.listConsumerGroupsPage()` (and their non-paginated 
counterparts for consistency).
   2. Pass `clusterId` through from `MetadataService` to the provider.
   3. In `ApacheInstanceProvider`, forward `clusterId` to the underlying 
`MetadataProvider` query.
   
   The regression tests described in the issue body 
(`MetadataServiceClusterFilterTest`) correctly capture the expected behavior.
   
   ---
   *Automated evaluation by RockteMQ-AI*
   


-- 
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