You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/09 13:13:31 UTC

[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4798: [ISSUE #4791] Add elect master command for admin CLI

hzh0425 commented on code in PR #4798:
URL: https://github.com/apache/rocketmq/pull/4798#discussion_r941323588


##########
controller/src/main/java/org/apache/rocketmq/controller/impl/manager/ReplicasInfoManager.java:
##########
@@ -160,25 +161,30 @@ public ControllerResult<ElectMasterResponseHeader> electMaster(
             // First, check whether the master is still active
             final String oldMaster = syncStateInfo.getMasterAddress();
             if (StringUtils.isNoneEmpty(oldMaster) && brokerAlivePredicate.test(brokerInfo.getClusterName(), oldMaster)) {
-                String err = String.format("The old master %s is still alive, not need to elect new master for broker %s", oldMaster, brokerInfo.getBrokerName());
-                log.warn("{}", err);
-                result.setCodeAndRemark(ResponseCode.CONTROLLER_INVALID_REQUEST, err);
-                return result;
+
+                if (StringUtils.isBlank(assignBrokerAddress) || StringUtils.equals(oldMaster, assignBrokerAddress)) {
+                    String err = String.format("The old master %s is still alive, not need to elect new master for broker %s", oldMaster, brokerInfo.getBrokerName());

Review Comment:
   This err log is inappropriate here



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org