Skip to content

When I use the multi-registry feature of Dubbo with setting namingLoadCacheAtStart=true, the cache of NacosNamingService will overwrite each other #5747

@plusmancn

Description

@plusmancn

Describe the bug
When I use the multi-registry feature of Dubbo with setting namingLoadCacheAtStart=true(default is also true in Dubbo), the cache of NacosNamingService will overwrite each other.
If two registries have different services, some of the services will be lost because of overwriting.

For example, we have settings as below:

<dubbo:registry id="registryDev" address="nacos://127.0.0.1:8849?namingLoadCacheAtStart=false"/>
<dubbo:registry id="registryTest" address="nacos://127.0.0.1:8848?namingLoadCacheAtStart=false"/>

If registryStable overwrites registryDev, the consumer can't find the GreetingService in registryDev.
image

Expected behavior
The different registry has different cache folder, so the cache will not overwrite each other.

PS: zookeeper works well with multi-registry feature of Dubbo.

Acutally behavior
The cache of NacosNamingService will overwrite each other.
If two registries have different services, some of the services will be lost because of overwriting.

How to Reproduce
Steps to reproduce the behavior:

  1. Using Nacos as Dubbo register center
  2. Reference above.

Desktop (please complete the following information):

  • OS: Mac M1
  • Version: NacosClient1.x, NacosClient2.x
  • Module: nacos client, nacos api
  • SDK: com.alibaba.nacos:nacos-client(Java Version)

Additional context
nope

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementCategory issues or prs related to enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions