You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zjncs (via GitHub)" <gi...@apache.org> on 2026/09/11 07:14:35 UTC

[PR] fix(tools): scope rocksDBConfigToJson rpc mode to the requested cluster [rocketmq]

zjncs opened a new pull request, #11147:
URL: https://github.com/apache/rocketmq/pull/11147

   ### Motivation
   
   `handleRpcMode` of `mqadmin rocksDBConfigToJson` validated the `-c` cluster name but then walked the whole `brokerAddrTable`, so the export request was sent to the masters of every cluster instead of only the requested one. Brokers without a master resolved to a null address, which `defaultMQAdminExtImpl` silently routed through the name server channel.
   
   ### Modifications
   
   Iterate the brokers of the requested cluster and skip master-less brokers.
   
   ### Verification
   
   Fail-before (new test, run against the unpatched code):
   
   ```
   RocksDBConfigToJsonRpcModeTest#testRpcModeOnlyExportsBrokersOfSpecifiedCluster
   java.lang.RuntimeException: RocksDBConfigToJsonCommand command failed
     at RocksDBConfigToJsonCommand.handleRpcMode(RocksDBConfigToJsonCommand.java:280)
   (export request hit a master-less broker outside the requested cluster)
   ```
   
   Pass-after:
   
   ```
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- RocksDBConfigToJsonRpcModeTest
   ```
   


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