Skip to content

Commit

Permalink
Try to fix alibaba#4573,alibaba#4629. Jraft leader status check error.
Browse files Browse the repository at this point in the history
  • Loading branch information
KomachiSion committed Mar 17, 2021
1 parent 4029d32 commit 87ca61b
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 87ca61b

Please sign in to comment.