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

3.x version, application-level registration, one protocol, multiple ports, only one protocol for one port registered in the registry #10958

Closed
1 task done
shihy0923 opened this issue Nov 18, 2022 · 5 comments · Fixed by #11102
Labels
type/bug Bugs to being fixed

Comments

@shihy0923
Copy link

shihy0923 commented Nov 18, 2022

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

Environment

  • Dubbo version: Dubbo3.x
  • Operating System version: win10
  • Java version: jdk1.8

Steps to reproduce this issue

  1. In three. In version X, integrate springboot, configured in the YML file as follows:
dubbo:
  application:
    name: dubbo-springboot-demo-provider
    metadata-type: local

  protocols:
    p1:
      name: dubbo
      port: 20883
    p3:
      name: dubbo
      port: 50052

  registry:
    address: zookeeper://127.0.0.1:2181

At 2.7. In version X, the provider provides a Dubbo service on two ports, 20883,50052, but in 3. X, found in application-level metadata: Dubbo. In the endpoints node, only one port, 50052, is registered, not 20883

{
    "name": "dubbo-springboot-demo-provider",
    "id": "192.168.3.12:20883",
    "address": "192.168.3.12",
    "port": 20883,
    "sslPort": null,
    "payload": {
        "@class": "org.apache.dubbo.registry.zookeeper.ZookeeperInstance",
        "id": "192.168.3.12:20883",
        "name": "dubbo-springboot-demo-provider",
        "metadata": {
            "dubbo.endpoints": "[{\"port\":50052,\"protocol\":\"dubbo\"}]",
            "dubbo.metadata-service.url-params": "{\"connections\":\"1\",\"version\":\"1.0.0\",\"dubbo\":\"2.0.2\",\"release\":\"3.1.2-SNAPSHOT\",\"side\":\"provider\",\"port\":\"20883\",\"protocol\":\"dubbo\"}",
            "dubbo.metadata.revision": "4aa675d2c4cb67397f868663d408587f",
            "dubbo.metadata.storage-type": "local",
            "timestamp": "1668756205371"
        }
    },
    "registrationTimeUTC": 1668763120468,
    "serviceType": "DYNAMIC",
    "uriSpec": null
}

After viewing the source code, the org.apache.dubbo.registry.client.metadata.ProtocolPortsMetadataCustomizer#customizeMethod, there is a description
The same protocol will be covered, so that the design will never know the existence of 20883 consumers
image

Pls. provide [GitHub address] to reproduce this issue.
https://github.com/apache/dubbo/blob/3.1/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ProtocolPortsMetadataCustomizer.java

Expected Behavior

In three. In application-level registration for version X, you can register both ports 20883 and 50052

Actual Behavior

If there is an exception, please attach the exception trace:
At this point, there is no impact on usage, but the provider has opened an additional port, resulting in waste of resources and confusion of users

@shihy0923 shihy0923 added the type/bug Bugs to being fixed label Nov 18, 2022
@AlbumenJ
Copy link
Member

What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster.

@shihy0923
Copy link
Author

What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster.

配置单协议和多端口的目的是什么,这样的配置对集群没有好处。

The multi-port configuration is probably to better support single-machine concurrency, and dubbo2.x supports such a configuration. If 3.x does not support such a configuration, should an error be reported during yml reading? Instead of starting normally and overwriting a port, it creates confusion for users because they don't know which port is valid

@AlbumenJ
Copy link
Member

AlbumenJ commented Nov 21, 2022

What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster.
配置单协议和多端口的目的是什么,这样的配置对集群没有好处。

The multi-port configuration is probably to better support single-machine concurrency, and dubbo2.x supports such a configuration. If 3.x does not support such a configuration, should an error be reported during yml reading? Instead of starting normally and overwriting a port, it creates confusion for users because they don't know which port is valid

Agree. We can find out these cases early and notify user.

@shihy0923
Copy link
Author

What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster.
配置单协议和多端口的目的是什么,这样的配置对集群没有好处。What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster. What is the purpose of configuring a single protocol and multiple ports? This configuration is not good for clustering.

The multi-port configuration is probably to better support single-machine concurrency, and dubbo2.x supports such a configuration. If 3.x does not support such a configuration, should an error be reported during yml reading? Instead of starting normally and overwriting a port, it creates confusion for users because they don't know which port is valid多端口配置可能更好地支持单机并发,Dubbo2.x 支持这种配置。如果3.x 不支持这样的配置,那么在读取 yml 时是否应该报告错误?它不是正常启动和覆盖端口,而是给用户造成混乱,因为他们不知道哪个端口是有效的

Agree. We can find out these cases early and notify user.

同意。我们可以尽早发现这些情况并通知用户。

Therefore, do we need to fix this little bug?

@AlbumenJ
Copy link
Member

What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster.
配置单协议和多端口的目的是什么,这样的配置对集群没有好处。What is the purpose of configuring single-protocol and multi-port, such a configuration has no good benefits for the cluster. What is the purpose of configuring a single protocol and multiple ports? This configuration is not good for clustering.

The multi-port configuration is probably to better support single-machine concurrency, and dubbo2.x supports such a configuration. If 3.x does not support such a configuration, should an error be reported during yml reading? Instead of starting normally and overwriting a port, it creates confusion for users because they don't know which port is valid多端口配置可能更好地支持单机并发,Dubbo2.x 支持这种配置。如果3.x 不支持这样的配置,那么在读取 yml 时是否应该报告错误?它不是正常启动和覆盖端口,而是给用户造成混乱,因为他们不知道哪个端口是有效的

Agree. We can find out these cases early and notify user.
同意。我们可以尽早发现这些情况并通知用户。

Therefore, do we need to fix this little bug?

Yes, if you willing to, please go ahead.

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
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants