Skip to content

Commit

Permalink
Try to fix #4573,#4629. Jraft leader status check error. (#5129)
Browse files Browse the repository at this point in the history
  • Loading branch information
KomachiSion committed Mar 18, 2021
1 parent 0003267 commit f1cf643
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public PersistentServiceProcessor(ProtocolManager protocolManager, ClusterVersio
@Override
public void afterConstruct() {
super.afterConstruct();
this.protocol.addRequestProcessors(Collections.singletonList(this));
this.protocol.protocolMetaData()
.subscribe(Constants.NAMING_PERSISTENT_SERVICE_GROUP, MetadataKey.LEADER_META_DATA,
(o, arg) -> hasLeader = StringUtils.isNotBlank(String.valueOf(arg)));
this.protocol.addRequestProcessors(Collections.singletonList(this));
// If you choose to use the new RAFT protocol directly, there will be no compatible logical execution
if (EnvUtil.getProperty(Constants.NACOS_NAMING_USE_NEW_RAFT_FIRST, Boolean.class, false)) {
NotifyCenter.registerSubscriber(notifier);
Expand Down

0 comments on commit f1cf643

Please sign in to comment.