[ISSUE #7626] Topic perm was mistakenly changed to 4 in dledger mode (#7661)

Signed-off-by: littleboy <2283985296@qq.com>
This commit is contained in:
littleboy
2023-12-15 17:49:47 +08:00
committed by GitHub
parent 23ee0eaaef
commit 7e1786732c
@@ -301,6 +301,7 @@ public class RouteInfoManager {
registerFirst = registerFirst || (StringUtils.isEmpty(oldAddr));
boolean isMaster = MixAll.MASTER_ID == brokerId;
boolean isPrimeSlave = !isOldVersionBroker && !isMaster
&& brokerId == Collections.min(brokerAddrsMap.keySet());
@@ -339,7 +340,8 @@ public class RouteInfoManager {
topicConfigWrapper.getDataVersion(), brokerName,
entry.getValue().getTopicName())) {
final TopicConfig topicConfig = entry.getValue();
if (isPrimeSlave) {
// In Slave Acting Master mode, Namesrv will regard the surviving Slave with the smallest brokerId as the "agent" Master, and modify the brokerPermission to read-only.
if (isPrimeSlave && brokerData.isEnableActingMaster()) {
// Wipe write perm for prime slave
topicConfig.setPerm(topicConfig.getPerm() & (~PermName.PERM_WRITE));
}