This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 82492a620 [ISSUE #6926] Fixing the error in the initialization order
of replicasManager caused the controller mode to fail to start.
82492a620 is described below
commit 82492a6208197f19b372b25aef4185b8defc8399
Author: rongtong <[email protected]>
AuthorDate: Fri Jun 23 10:56:18 2023 +0800
[ISSUE #6926] Fixing the error in the initialization order of
replicasManager caused the controller mode to fail to start.
---
.../java/org/apache/rocketmq/broker/BrokerController.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git
a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
index 03e9b3241..191c690f9 100644
--- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
+++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
@@ -761,9 +761,6 @@ public class BrokerController {
messageStoreConfig, brokerStatsManager,
messageArrivingListener, brokerConfig, configuration);
this.messageStore = MessageStoreFactory.build(context,
defaultMessageStore);
this.messageStore.getDispatcherList().addFirst(new
CommitLogDispatcherCalcBitMap(this.brokerConfig, this.consumerFilterManager));
- if (this.brokerConfig.isEnableControllerMode()) {
- this.replicasManager = new ReplicasManager(this);
- }
if (messageStoreConfig.isTimerWheelEnable()) {
this.timerCheckpoint = new
TimerCheckpoint(BrokerPathConfigHelper.getTimerCheckPath(messageStoreConfig.getStorePathRootDir()));
TimerMetrics timerMetrics = new
TimerMetrics(BrokerPathConfigHelper.getTimerMetricsPath(messageStoreConfig.getStorePathRootDir()));
@@ -785,11 +782,6 @@ public class BrokerController {
return false;
}
- if (this.brokerConfig.isEnableControllerMode()) {
- this.replicasManager.setFenced(true);
- }
-
-
result = this.initializeMessageStore();
if (!result) {
return false;
@@ -802,6 +794,11 @@ public class BrokerController {
boolean result = true;
+ if (this.brokerConfig.isEnableControllerMode()) {
+ this.replicasManager = new ReplicasManager(this);
+ this.replicasManager.setFenced(true);
+ }
+
if (messageStore != null) {
registerMessageStoreHook();
result = this.messageStore.load();