echooymxq commented on code in PR #6506:
URL: https://github.com/apache/rocketmq/pull/6506#discussion_r1152639587
##########
controller/src/main/java/org/apache/rocketmq/controller/impl/manager/ReplicasInfoManager.java:
##########
@@ -533,7 +533,7 @@ private void handleElectMaster(final ElectMasterEvent
event) {
} else {
// If new master was not elected, which means old master was
shutdown and the newSyncStateSet list had no more replicas
// So we should delete old master, but retain newSyncStateSet
list.
- syncStateInfo.updateMasterInfo(null);
+ syncStateInfo.cleanMasterInfo();
Review Comment:
Ok, let me understand what you mean.
> it appears that the broker will not actively trigger a re election in the
current implementation.
Because in current implementation, broker will send elect request proactive
when the epoch increased and master is null. code as follow:
```java
if (newMasterEpoch > this.masterEpoch) {
if (StringUtils.isNoneEmpty(newMasterAddress) && masterBrokerId !=
null) {
....
} else {
// In this case, the master in controller is null, try elect in
controller, this will trigger the electMasterEvent in controller.
brokerElect();
}
}
```
If the epoch not increased when the master shutdown, this step maybe never
occur. But discontinuous incremental epochs can be very confusing.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]