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

tri使用多注册中心问题 #9322

Closed
1 task
feng996 opened this issue Nov 26, 2021 · 5 comments
Closed
1 task

tri使用多注册中心问题 #9322

feng996 opened this issue Nov 26, 2021 · 5 comments
Labels
type/bug Bugs to being fixed
Milestone

Comments

@feng996
Copy link

feng996 commented Nov 26, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.0.4
  • Operating System version: Ubuntu 18.04
  • Java version: 11

Steps to reproduce this issue

consumer引用多注册中心的provider,只有一个provider能使用
debug发现,其他的reference在设置serviceUrls时(ServiceInstancesChangedListener#onEvent)拿不到MetadataInfo
多配置中心没有生效。实际MetadataReportInstance只持有一个MetadataReport。

通过MetadataReportInstance#init发现

 if (!init.compareAndSet(false, true)) {
            return;
 }

只会init一次
为什么会这么设计呢?

DefaultApplicationDeployer#startMetadataCenter里关于配置中心的设置

for (MetadataReportConfig metadataReportConfig : metadataReportConfigs) {
            ConfigValidationUtils.validateMetadataConfig(metadataReportConfig);
            if (!metadataReportConfig.isValid()) {
                logger.info("Ignore invalid metadata-report config: " + metadataReportConfig);
                continue;
            }
            metadataReportInstance.init(metadataReportConfig);
 }
@feng996 feng996 added the type/bug Bugs to being fixed label Nov 26, 2021
@feng996
Copy link
Author

feng996 commented Nov 26, 2021

应用级服务发现时,consumer多注册中心使用同名的provider,某个注册中心的服务下线,会通知所有的registry,导致所有的reference都失效。重启后除了这个注册中心的服务可用,其他服务不可用。

@EarthChen
Copy link
Member

EarthChen commented Nov 27, 2021

看你的描述 应该不是 tri 协议导致的把?
因为对于服务注册和发现 不在协议层处理。也就是说,如果描述的现象存在,那就是个共性问题

@feng996
Copy link
Author

feng996 commented Nov 27, 2021

是的,应该是服务发现的问题,接口级可以通过group来区分同名接口的通知,应用级group都是default不可修改,所以就会有通知的问题。

@chickenlj
Copy link
Contributor

if (!init.compareAndSet(false, true)) {
return;
}

该问题将在 3.0.6 版本中修复

@chickenlj chickenlj added this to the 3.0.6 milestone Dec 15, 2021
@chickenlj
Copy link
Contributor

当前参见 3.0-metadata-refactor 分支

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

3 participants