Skip to content

Commit

Permalink
Change the loading order of HAService
Browse files Browse the repository at this point in the history
  • Loading branch information
RongtongJin committed Jul 14, 2022
1 parent 67a5262 commit cc4c196
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ public DefaultMessageStore(final MessageStoreConfig messageStoreConfig, final Br
this.correctLogicOffsetService = new CorrectLogicOffsetService();
this.storeStatsService = new StoreStatsService(getBrokerIdentity());
this.indexService = new IndexService(this);

if (!messageStoreConfig.isEnableDLegerCommitLog() && !this.messageStoreConfig.isDuplicationEnable()) {
this.haService = ServiceProvider.loadClass(ServiceProvider.HA_SERVICE_ID, HAService.class);
if (null == this.haService) {
if (brokerConfig.isEnableControllerMode()) {
this.haService = new AutoSwitchHAService();
LOGGER.warn("Load AutoSwitch HA Service: {}", AutoSwitchHAService.class.getSimpleName());
} else {
if (brokerConfig.isEnableControllerMode()) {
this.haService = new AutoSwitchHAService();
LOGGER.warn("Load AutoSwitch HA Service: {}", AutoSwitchHAService.class.getSimpleName());
} else {
this.haService = ServiceProvider.loadClass(ServiceProvider.HA_SERVICE_ID, HAService.class);
if (null == this.haService) {
this.haService = new DefaultHAService();
LOGGER.warn("Load default HA Service: {}", DefaultHAService.class.getSimpleName());
}
Expand Down

0 comments on commit cc4c196

Please sign in to comment.