From f1cf643b81ff9629887a2e05ef900dac6a5da3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=BF=8A=20SionYang?= <263976490@qq.com> Date: Thu, 18 Mar 2021 11:11:45 +0800 Subject: [PATCH] Try to fix #4573,#4629. Jraft leader status check error. (#5129) --- .../consistency/persistent/impl/PersistentServiceProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java index 46a90c6dc..5fbc87e30 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java @@ -65,10 +65,10 @@ public class PersistentServiceProcessor extends BasePersistentServiceProcessor { @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); -- GitLab