提交 7b429097 编写于 作者: D dongeforever

Review code and fix

上级 b9ed0ab9
...@@ -786,7 +786,7 @@ public class BrokerController { ...@@ -786,7 +786,7 @@ public class BrokerController {
if (messageStoreConfig.isEnableDLegerCommitLog()) { if (messageStoreConfig.isEnableDLegerCommitLog()) {
changeToSlave(((DLegerCommitLog)((DefaultMessageStore) messageStore).getCommitLog()).getId()); changeToSlave(((DLegerCommitLog)((DefaultMessageStore) messageStore).getCommitLog()).getId());
} else { } else {
startProcessorByHa(); startProcessorByHa(messageStoreConfig.getBrokerRole());
handleSlaveSynchronize(messageStoreConfig.getBrokerRole()); handleSlaveSynchronize(messageStoreConfig.getBrokerRole());
} }
...@@ -1049,7 +1049,7 @@ public class BrokerController { ...@@ -1049,7 +1049,7 @@ public class BrokerController {
log.error("ScheduledTask SlaveSynchronize syncAll error.", e); log.error("ScheduledTask SlaveSynchronize syncAll error.", e);
} }
} }
}, 1000 * 3, 1000 * 3, TimeUnit.MILLISECONDS); }, 1000 * 3, 1000 * 10, TimeUnit.MILLISECONDS);
} else { } else {
//handle the slave synchronise //handle the slave synchronise
if (null != slaveSyncFuture) { if (null != slaveSyncFuture) {
...@@ -1098,7 +1098,7 @@ public class BrokerController { ...@@ -1098,7 +1098,7 @@ public class BrokerController {
this.messageStore.handleScheduleMessageService(role); this.messageStore.handleScheduleMessageService(role);
//handle the transactional service //handle the transactional service
this.startProcessorByHa(); this.startProcessorByHa(BrokerRole.SYNC_MASTER);
//if the operations above are totally successful, we change to master //if the operations above are totally successful, we change to master
brokerConfig.setBrokerId(0); //TO DO check brokerConfig.setBrokerId(0); //TO DO check
...@@ -1112,8 +1112,8 @@ public class BrokerController { ...@@ -1112,8 +1112,8 @@ public class BrokerController {
log.info("Finish to change to master brokerName={}", brokerConfig.getBrokerName()); log.info("Finish to change to master brokerName={}", brokerConfig.getBrokerName());
} }
private void startProcessorByHa() { private void startProcessorByHa(BrokerRole role) {
if (BrokerRole.SLAVE != messageStoreConfig.getBrokerRole()) { if (BrokerRole.SLAVE != role) {
if (this.transactionalMessageCheckService != null) { if (this.transactionalMessageCheckService != null) {
this.transactionalMessageCheckService.start(); this.transactionalMessageCheckService.start();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册