You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "RongtongJin (via GitHub)" <gi...@apache.org> on 2023/03/17 07:12:28 UTC

[GitHub] [rocketmq] RongtongJin commented on a diff in pull request #6383: [ISSUE #6382] Periodically check for inactive masters

RongtongJin commented on code in PR #6383:
URL: https://github.com/apache/rocketmq/pull/6383#discussion_r1139827440


##########
common/src/main/java/org/apache/rocketmq/common/ControllerConfig.java:
##########
@@ -42,7 +43,7 @@ public class ControllerConfig {
     private String controllerDLegerPeers;
     private String controllerDLegerSelfId;
     private int mappedFileSize = 1024 * 1024 * 1024;
-    private String controllerStorePath = System.getProperty("user.home") + File.separator + "DledgerController";
+    private String controllerStorePath = System.getProperty("user.home") + File.separator + "DLedgerController";

Review Comment:
   改变store目录可能会有兼容性问题,建议不修改



##########
controller/src/main/java/org/apache/rocketmq/controller/impl/manager/ReplicasInfoManager.java:
##########
@@ -425,6 +425,25 @@ public ControllerResult<Void> cleanBrokerData(final CleanControllerBrokerDataReq
         return result;
     }
 
+    public List<String/*BrokerName*/> scanNeedReelectBrokerSets(final BrokerValidPredicate validPredicate) {
+        List<String> needReelectBrokerSets = new LinkedList<>();
+        this.syncStateSetInfoTable.forEach((brokerName, syncStateInfo) -> {
+            Long masterBrokerId = syncStateInfo.getMasterBrokerId();
+            String clusterName = syncStateInfo.getClusterName();
+            // Now master is inactive
+            if (masterBrokerId != null && !validPredicate.check(clusterName, brokerName, masterBrokerId)) {

Review Comment:
   masterBrokerId == null的时候应该也要主动触发选举吧



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