Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pixystone opened this issue May 11, 2021 · 0 comments
Closed
Labels
kind/bug Category issues or prs related to bug. version/2.x
Milestone

Comments

@pixystone
Copy link
Contributor

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.

pixystone added a commit to pixystone/nacos that referenced this issue May 11, 2021
pixystone added a commit to pixystone/nacos that referenced this issue May 11, 2021
KomachiSion pushed a commit that referenced this issue May 11, 2021
* [ISSUE #5671] Prefer serviceV2.groupName using groupName in serviceV1.name

* [ISSUE #5671] Add groupName to service when creating by v1 operator
@KomachiSion KomachiSion added kind/bug Category issues or prs related to bug. version/2.x labels May 11, 2021
@KomachiSion KomachiSion added this to the 2.0.2 milestone May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug. version/2.x
Projects
None yet
Development

No branches or pull requests

2 participants