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


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -293,8 +293,10 @@ public RegisterBrokerResult registerBroker(
             registerFirst = registerFirst || (StringUtils.isEmpty(oldAddr));
 
             boolean isMaster = MixAll.MASTER_ID == brokerId;
+
+            // isPrimeSlave < Slave Acting 
Master模式下,Namesrv将把brokerId最小的存活Slave视为“代理”Master,并将brokerPermission修改为4(Read-Only)>
             boolean isPrimeSlave = !isOldVersionBroker && !isMaster
-                && brokerId == Collections.min(brokerAddrsMap.keySet());
+                && brokerId == Collections.min(brokerAddrsMap.keySet()) && 
!brokerAddrsMap.containsKey(0L);

Review Comment:
   我觉得最好不要在这里修改,而是再擦除写权限的时候,看看是不是brokerData是不是打开enableActingMaster的



##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -293,8 +293,10 @@ public RegisterBrokerResult registerBroker(
             registerFirst = registerFirst || (StringUtils.isEmpty(oldAddr));
 
             boolean isMaster = MixAll.MASTER_ID == brokerId;
+
+            // isPrimeSlave < Slave Acting 
Master模式下,Namesrv将把brokerId最小的存活Slave视为“代理”Master,并将brokerPermission修改为4(Read-Only)>

Review Comment:
   注释不能用中文



-- 
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-unsubscr...@rocketmq.apache.org

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

Reply via email to