diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceOperatorV1Impl.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceOperatorV1Impl.java index 102a89739..dfa3ac3d0 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceOperatorV1Impl.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceOperatorV1Impl.java @@ -61,6 +61,7 @@ public class ServiceOperatorV1Impl implements ServiceOperator { service.setMetadata(metadata.getExtendData()); service.setSelector(metadata.getSelector()); service.setNamespaceId(namespaceId); + service.setGroupName(NamingUtils.getGroupName(serviceName)); // now valid the service. if failed, exception will be thrown service.setLastModifiedMillis(System.currentTimeMillis()); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/delay/ServiceChangeV1Task.java b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/delay/ServiceChangeV1Task.java index a9f880f0e..d34ebe102 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/delay/ServiceChangeV1Task.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/delay/ServiceChangeV1Task.java @@ -151,7 +151,7 @@ public class ServiceChangeV1Task extends AbstractDelayTask { private com.alibaba.nacos.naming.core.v2.pojo.Service transfer(Service service, boolean ephemeral) { return com.alibaba.nacos.naming.core.v2.pojo.Service - .newService(service.getNamespaceId(), service.getGroupName(), + .newService(service.getNamespaceId(), NamingUtils.getGroupName(service.getName()), NamingUtils.getServiceName(service.getName()), ephemeral); } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/execute/AsyncServicesCheckTask.java b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/execute/AsyncServicesCheckTask.java index 30d477abc..10c4f38ba 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/execute/AsyncServicesCheckTask.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/upgrade/doublewrite/execute/AsyncServicesCheckTask.java @@ -71,7 +71,7 @@ public class AsyncServicesCheckTask extends AbstractExecuteTask { if (upgradeJudgement.isUseGrpcFeatures()) { return; } - String groupName = serviceV1.getGroupName(); + String groupName = NamingUtils.getGroupName(serviceV1.getName()); String serviceName = NamingUtils.getServiceName(fullServiceName); com.alibaba.nacos.naming.core.v2.pojo.Service serviceV2 = com.alibaba.nacos.naming.core.v2.pojo.Service .newService(namespace, groupName, serviceName);