diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java index a379a8e2b..19337a33e 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java @@ -445,9 +445,9 @@ public class ServiceManager implements RecordListener { service.getClusterMap().put(cluster.getName(), cluster); } service.validate(); - if (local) { - putServiceAndInit(service); - } else { + + putServiceAndInit(service); + if (!local) { addOrReplaceService(service); } } @@ -470,9 +470,9 @@ public class ServiceManager implements RecordListener { service.getClusterMap().put(cluster.getName(), cluster); } service.validate(); - if (local) { - putServiceAndInit(service); - } else { + + putServiceAndInit(service); + if (!local) { addOrReplaceService(service); } }