-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
[BUG] Use the multi-registry feature with Nacos registry that set namingLoadCacheAtStart=true, the cache of NacosNamingService will overwrite each other #7822
Comments
Final Solution
I have submitted PRs to both Nacos Client v1.x and v2.x, see: alibaba/nacos#5747.
Lines 145 to 155 in ff50f91
Try to Calculate the cacheDir path of Nacos Registry automatically, and then set it by properties. Temporary SolutionJust set <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"/> |
How to use it.From Dubbo 3.0.2(which Nacos dependency 2.0.2), just set <dubbo:registry id="registryDev" address="nacos://127.0.0.1:8849?namingCacheRegistryDir=sub1"/>
<dubbo:registry id="registryTest" address="nacos://127.0.0.1:8848?namingCacheRegistryDir=sub2"/> |
@plusmancn Could you please help to add some description related with this issue to apache/dubbo-website ? |
I will |
Environment
Steps to reproduce this issue
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:
If registryStable overwrites registryDev, the consumer can't find the GreetingService in registryDev.
Expected Result
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.
Actual Result
The cache of NacosNamingService will overwrite each other.
If two registries have different services, some of the services will be lost because of overwriting.
The text was updated successfully, but these errors were encountered: