apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.54k stars 26.44k forks source link

[Bug] change provider application name,consumer can not subscrib #14761

Closed tinybyhuang closed 2 weeks ago

tinybyhuang commented 1 month ago

Pre-check

Search before asking

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.2.9, OracleJDK 1.8,centos7,Dubbo register:阿里云MSE(nacos 2.1.2.0)Dubbo register mode:instance

Steps to reproduce this issue

  1. Change the provider application name (e.g., dubbo.application.name from patient-service-provider to distinct-patient-service).

  2. Restart one provider instance (e.g., 10.0.18.9), and the consumer cannot subscribe normally.

  3. Restart all provider instances, and the consumer reports "no provider available."

What you expected to happen

The consumer subscribes normally

Anything else

Some consumer logs show that the restarted instance (10.0.18.9) cannot be added to the invokers.

class:o.a.d.r.c.directory.AbstractDirectory level:INFO message: [DUBBO] The invoker DefaultServiceInstance{serviceName='patient-service-provider', host='10.0.18.9', port=21350, enabled=true, healthy=true, metadata={dubbo.metadata-service.url-params={"serialization":"hessian2","prefer.serialization":"hessian2","version":"1.0.0","dubbo":"2.0.2","release":"3.2.9","side":"provider","port":"21350","protocol":"dubbo"}, dubbo.endpoints=[{"port":21350,"protocol":"dubbo"}], dubbo.metadata.revision=60a6cb6dc32ee581ff3f6d4eedea2283, dubbo.metadata.storage-type=local, timestamp=1725285283509}}, service{name='com.distinct.patient.api.PatientApi',group='null',version='1.0.0',protocol='dubbo',port='21350',params={side=provider, release=3.2.9, methods=createPatentdeprecated=false, dubbo=2.0.2, interface=com.distinct.patient.api.PatientApi, service-name-mapping=true, version=1.0.0, timeout=30000, generic=false, revision=1.0.0, serialize.check.status=WARN, serialization=hessian2, application=patient-service-provider, prefer.serialization=hessian2, dynamic=true, REGISTRY_CLUSTER=nacos-registry},} has been added to invalidate list due to connectivity problem. Will trying to reconnect to it in the background., dubbo version: 3.2.9, current host: 10.0.18.9 收起 string:- thread:http-nio-8330-exec-357 time:12:47:12.846

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] Received instance notification, serviceName: patient-service-provider, instances: 1, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.916

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] 1 unique working revisions: 60a6cb6dc32ee581ff3f6d4eedea2283 , dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.916

class:o.a.d.r.t.netty4.NettyClientHandler level:INFO message: [DUBBO] The connection of /10.0.18.9:55504 -> /10.0.18.9:21350 is disconnected., dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:NettyClientWorker-8-5 time:12:47:13.925

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] 1 deprecated invokers deleted., dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.926

class:o.a.d.r.c.m.DefaultMigrationAddressComparator level:INFO message: [DUBBO] No interface address available, stop compare., dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.926

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Received invokers changed event from registry. Registry type: instance. Service Key: com.distinct.patient.api.PatientApi:1.0.0. Urls Size : 1. Invokers Size : 1. Available Size: 1. Available Invokers : 10.0.19.3:21350, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.926

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] Received instance notification, serviceName: patient-service-provider, instances: 1, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.671

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] 1 unique working revisions: 60a6cb6dc32ee581ff3f6d4eedea2283 , dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.671

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Refreshed invoker size 1 from registry ServiceDiscoveryRegistryDirectory(registry: mse-a5f24900-nacos-ans.mse.aliyuncs.com:8848, subscribed key: [patient-service-provider])-Directory(invokers: 2[10.0.19.3:21350, 10.0.18.9:21350], validInvokers: 2[10.0.19.3:21350, 10.0.18.9:21350], invokersToReconnect: 0[]), dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.916

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] Notify service com.distinct.patient.api.PatientApi:1.0.0:null with urls 1, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.919

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Refreshed invoker size 1 from registry ServiceDiscoveryRegistryDirectory(registry: mse-a5f24900-nacos-ans.mse.aliyuncs.com:8848, subscribed key: [patient-service-provider])-Directory(invokers: 2[10.0.18.9:21350, 10.0.19.3:21350], validInvokers: 1[10.0.19.3:21350], invokersToReconnect: 1[10.0.18.9:21350]), dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.919

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Received invokers changed event from registry. Registry type: instance. Service Key: com.distinct.patient.api.PatientApi:1.0.0. Urls Size : 1. Invokers Size : 1. Available Size: 1. Available Invokers : 10.0.19.3:21350, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:47:13.926

class:o.a.d.r.c.ServiceDiscoveryRegistry$DefaultMappingListener level:INFO message: [DUBBO] Mapping of service com.distinct.patient.api.AppFamilyMemberApichanged from null to [distinct-patient-service, patient-service-provider], dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.663

class:o.a.d.r.c.ServiceDiscoveryRegistry$DefaultMappingListener level:INFO message: [DUBBO] Received mapping notification from meta server, {serviceKey: com.distinct.patient.api.PatientApi, apps: [distinct-patient-service, patient-service-provider]}, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.760

class:o.a.d.r.c.ServiceDiscoveryRegistry$DefaultMappingListener level:INFO message: [DUBBO] Mapping of service com.distinct.patient.api.PatientApichanged from null to [distinct-patient-service, patient-service-provider], dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.760

class:o.a.d.r.client.ServiceDiscoveryRegistry level:INFO message: [DUBBO] Trying to subscribe from apps distinct-patient-service,patient-service-provider for service key com.distinct.patient.api.PatientApi:1.0.0, , dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.760

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] Notify serviceKey: com.distinct.patient.api.PatientApi:1.0.0:null, listener: ServiceDiscoveryRegistryDirectory(registry: mse-a5f24900-nacos-ans.mse.aliyuncs.com:8848, subscribed key: [distinct-patient-service, patient-service-provider])-Directory(invokers: 1[10.0.19.3:21350], validInvokers: 1[10.0.19.3:21350], invokersToReconnect: 0[]) with 1 urls on subscription, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.760

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Refreshed invoker size 1 from registry ServiceDiscoveryRegistryDirectory(registry: mse-a5f24900-nacos-ans.mse.aliyuncs.com:8848, subscribed key: [distinct-patient-service, patient-service-provider])-Directory(invokers: 1[10.0.19.3:21350], validInvokers: 1[10.0.19.3:21350], invokersToReconnect: 0[]), dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.761

class:o.a.d.r.c.m.DefaultMigrationAddressComparator level:INFO message: [DUBBO] No interface address available, stop compare., dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.761

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Received invokers changed event from registry. Registry type: instance. Service Key: com.distinct.patient.api.PatientApi:1.0.0. Urls Size : 1. Invokers Size : 1. Available Size: 1. Available Invokers : 10.0.19.3:21350, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.client.cachedata.internal.notifier time:12:48:26.761

class:org.apache.dubbo.rpc.model.ModuleModel level:INFO message: [DUBBO] Dynamically registering consumer model distinct-patient-service/org.apache.dubbo.metadata.MetadataService:1.0.0 into model Dubbo Module[1.1.0], dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:48:30.678

class:o.a.d.r.t.netty4.NettyClientHandler level:INFO message: [DUBBO] The connection of /10.0.18.9:48592 -> /10.0.18.9:21350 is established., dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:NettyClientWorker-8-1 time:12:48:30.679

class:o.a.d.remoting.transport.AbstractClient level:INFO message: [DUBBO] Successfully connect to server /10.0.18.9:21350 from NettyClient 10.0.18.9 using dubbo version 3.2.9, channel is NettyChannel [channel=[id: 0x8e8b9c1a, L:/10.0.18.9:48592 - R:/10.0.18.9:21350]], dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:48:30.680

class:o.a.d.r.c.e.l.ServiceInstancesChangedListener level:INFO message: [DUBBO] 2 unique working revisions: 60a6cb6dc32ee581ff3f6d4eedea2283 1619c6ec1ac88ec96848df730d81c457 , dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:48:30.744

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Refreshed invoker size 2 from registry ServiceDiscoveryRegistryDirectory(registry: mse-a5f24900-nacos-ans.mse.aliyuncs.com:8848, subscribed key: [distinct-patient-service, patient-service-provider])-Directory(invokers: 1[10.0.19.3:21350], validInvokers: 1[10.0.19.3:21350], invokersToReconnect: 0[]), dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:48:30.755

class:o.a.d.r.c.m.DefaultMigrationAddressComparator level:INFO message: [DUBBO] No interface address available, stop compare., dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:48:30.776

class:o.a.d.r.c.ServiceDiscoveryRegistryDirectory level:INFO message: [DUBBO] Received invokers changed event from registry. Registry type: instance. Service Key: com.distinct.patient.api.PatientApi:1.0.0. Urls Size : 2. Invokers Size : 2. Available Size: 2. Available Invokers : 10.0.18.9:21350,10.0.19.3:21350, dubbo version: 3.2.9, current host: 10.0.18.9 string:- thread:nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent time:12:48:30.792

class:o.a.d.r.c.directory.AbstractDirectory level:INFO message: [DUBBO] The invoker DefaultServiceInstance{serviceName='patient-service-provider', host='10.0.19.3', port=21350, enabled=true, healthy=true, metadata={dubbo.metadata-service.url-params={"serialization":"hessian2","prefer.serialization":"hessian2","version":"1.0.0","dubbo":"2.0.2","release":"3.2.9","side":"provider","port":"21350","protocol":"dubbo"}, dubbo.endpoints=[{"port":21350,"protocol":"dubbo"}], dubbo.metadata.revision=60a6cb6dc32ee581ff3f6d4eedea2283, dubbo.metadata.storage-type=local, timestamp=1727346836716}}, service{name='com.distinct.patient.api.PatientApi',group='null',version='1.0.0',protocol='dubbo',port='21350',params={side=provider, release=3.2.9, methods=createPatent,deprecated=false, dubbo=2.0.2, interface=com.distinct.patient.api.PatientApi, service-name-mapping=true, version=1.0.0, timeout=30000, generic=false, revision=1.0.0, serialize.check.status=WARN, serialization=hessian2, application=patient-service-provider, prefer.serialization=hessian2, dynamic=true, REGISTRY_CLUSTER=nacos-registry},} has been added to invalidate list due to connectivity problem. Will trying to reconnect to it in the background., dubbo version: 3.2.9, current host: 10.0.18.9 收起 string:- thread:http-nio-8330-exec-327 time:12:54:12.458

class:c.d.p.p.p.d.invoker.PatientApiInvoker level:ERROR message:调用getPatientById查询就诊人失败, result:Result{status=0, errorCode=0, errorMsg='No provider available from registry RegistryDirectory(registry: mse-a5f24900-nacos-ans.mse.aliyuncs.com:8848)-Directory(invokers: 0[], validInvokers: 0[], invokersToReconnect: 0[]) for service com.distinct.patient.api.PatientApi:1.0.0 on consumer 10.0.18.9 use dubbo version 3.2.9, please check status of providers(disabled, not registered or in blacklist).', data=null} string:- thread:http-nio-8330-exec-355 time:12:54:12.520

Are you willing to submit a pull request to fix on your own?

Code of Conduct