vongosling commented on a change in pull request #2167:
URL: https://github.com/apache/rocketmq/pull/2167#discussion_r502379370
##########
File path:
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
##########
@@ -1044,9 +1044,14 @@ public FindBrokerResult findBrokerAddressInSubscribe(
found = brokerAddr != null;
if (!found && !onlyThisBroker) {
- Entry<Long, String> entry = map.entrySet().iterator().next();
- brokerAddr = entry.getValue();
- slave = entry.getKey() != MixAll.MASTER_ID;
+ if (brokerId == 1 && map.size() > 2) {
+ brokerAddr = map.get(2L);
Review comment:
why just choose the concrete index 2 while not 3, 4 or other if size >
2? Is there any optimized space, image if the first follower also not
available?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]