123123213weqw opened a new pull request, #5770:
URL: https://github.com/apache/rocketmq-dashboard/pull/5770

   ## What
   
   `RocketMQClusterProvider.discoverClustersAt` walks the NameServer's
   `clusterAddrTable` in its natural iteration order. That table is a `HashMap`
   deserialized from the remoting response, so its iteration order is hash-based
   and effectively random per snapshot: the cluster list returned for the same
   instance can reshuffle between two consecutive requests, which makes the
   console's cluster selector and any diffing consumer flicker.
   
   `RealClusterProvider.toClusterVOs` already sorts its table walk by cluster
   name; the instance-backed provider did not.
   
   ## Fix
   
   Sort the `clusterAddrTable` entries by key before building the `ClusterVO`
   list, so both providers return clusters in the same stable name order.
   
   ## Test
   
   `discoverClustersShouldOrderClustersByNameRegardlessOfTableOrder` feeds a
   table whose insertion order is deliberately reverse-alphabetical and asserts
   the discovered list is name-ordered. Red on the current code (returns the
   table's insertion order), green after the sort.


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