提交 21511da3 编写于 作者: R rongtongjin

fix(broker):fix the issue that master node route info is lost when some node...

fix(broker):fix the issue that master node route info is lost when some node join the group in dledger mode

Since brokerId defaults to 0, it will register with nameserver before brokerId is changed when broker restart, causing the route info of master to be overwritten.
Set brokerId defaults to -1 in dledger mode and do not register wtih nameserver until brokerId is changed.

Close #1464
上级 9edeb4ec
...@@ -857,12 +857,9 @@ public class BrokerController { ...@@ -857,12 +857,9 @@ public class BrokerController {
if (!messageStoreConfig.isEnableDLegerCommitLog()) { if (!messageStoreConfig.isEnableDLegerCommitLog()) {
startProcessorByHa(messageStoreConfig.getBrokerRole()); startProcessorByHa(messageStoreConfig.getBrokerRole());
handleSlaveSynchronize(messageStoreConfig.getBrokerRole()); handleSlaveSynchronize(messageStoreConfig.getBrokerRole());
this.registerBrokerAll(true, false, true);
} }
this.registerBrokerAll(true, false, true);
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() { this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
......
...@@ -178,6 +178,10 @@ public class BrokerStartup { ...@@ -178,6 +178,10 @@ public class BrokerStartup {
break; break;
} }
if (messageStoreConfig.isEnableDLegerCommitLog()) {
brokerConfig.setBrokerId(-1);
}
messageStoreConfig.setHaListenPort(nettyServerConfig.getListenPort() + 1); messageStoreConfig.setHaListenPort(nettyServerConfig.getListenPort() + 1);
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator(); JoranConfigurator configurator = new JoranConfigurator();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册