Skip to content

[2.0.x] ServiceChangeV1Task may dismiss service groupName in service name #5671

@pixystone

Description

@pixystone

Describe the bug
com.alibaba.nacos.naming.core.v2.upgrade.doublewrite.delay.ServiceChangeV1Task.ServiceChangeV1TaskProcessor#transfer

serviceV2.groupName is coming from serviceV1.groupName

However, serviceV1.groupName are always DEFAULT_GROUP when sync from other server, see com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl#processData(byte[]):

                        Loggers.DISTRO.info("creating service {}", entry.getKey());
                        Service service = new Service();
                        String serviceName = KeyBuilder.getServiceName(entry.getKey());
                        String namespaceId = KeyBuilder.getNamespace(entry.getKey());
                        service.setName(serviceName);
                        service.setNamespaceId(namespaceId);
                        service.setGroupName(Constants.DEFAULT_GROUP);    //  <----- here

Expected behavior
Using NamingUtils.getGroupName(service.getName()) first to get groupName.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategory issues or prs related to bug.version/2.x

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions