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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]