Skip to content

Commit

Permalink
[ISSUE #7626] Topic perm was mistakenly changed to 4 in dledger mode (#…
Browse files Browse the repository at this point in the history
…7661)

Signed-off-by: littleboy <[email protected]>
  • Loading branch information
LittleBoy18 authored Dec 15, 2023
1 parent 23ee0ea commit 7e17867
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public RegisterBrokerResult registerBroker(
registerFirst = registerFirst || (StringUtils.isEmpty(oldAddr));

boolean isMaster = MixAll.MASTER_ID == brokerId;

boolean isPrimeSlave = !isOldVersionBroker && !isMaster
&& brokerId == Collections.min(brokerAddrsMap.keySet());

Expand Down Expand Up @@ -339,7 +340,8 @@ public RegisterBrokerResult registerBroker(
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));
}
Expand Down

0 comments on commit 7e17867

Please sign in to comment.