GitHub user wwj-radish added a comment to the discussion: controller通知broker变更
从日志上看,两个broker都进入了一次这个方法
```java
public void changeToMaster(final int newMasterEpoch, final int
syncStateSetEpoch, final Set<Long> syncStateSet)
```
之后日志也不打印了,可能是因为有这个限制把
```java
public void changeToMaster(final int newMasterEpoch, final int
syncStateSetEpoch, final Set<Long> syncStateSet) {
synchronized (this) {
if (newMasterEpoch > this.masterEpoch) {
...
}
}
public void changeToSlave(final String newMasterAddress, final int
newMasterEpoch, Long newMasterBrokerId) {
synchronized (this) {
if (newMasterEpoch > this.masterEpoch) {
...
}
}
```
然后因为controller主动通知变更角色失败了,两个broker就一直是master了...
GitHub link:
https://github.com/apache/rocketmq/discussions/6869#discussioncomment-6117793
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]