You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "bugCats (via GitHub)" <gi...@apache.org> on 2023/05/29 03:25:20 UTC

[GitHub] [rocketmq] bugCats opened a new issue, #6827: [Bug] 二副本对等部署,返回broker.endpoints.addresses有问题

bugCats opened a new issue, #6827:
URL: https://github.com/apache/rocketmq/issues/6827

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions)  of this repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   Linux centos7 version 3.10.0-514.6.2.el7.x86_64
   
   ### RocketMQ version
   
   5.1.1
   
   ### JDK Version
   
   1.8.0_11
   
   ### Describe the Bug
   
   二副本对等部署情况下,返回TopicRouteData:broker.endpoints.addresses端口错误。
   
   ### Steps to Reproduce
   
   我有2台服务器甲、乙;
   服务器甲部署:a0、b1节点,外网IP配置的域名:shiji.rmq;服务器乙部署:b0、a1节点,外网IP配置的域名:hsjl.rmq;
   这些域名都是自定义,需要在客户端上修改hosts文件。
   
   <pre>
   a0 broker.conf:
   brokerIP1=shiji.rmq
   brokerIP2=172.17.88.54
   
   b1 broker.conf:
   brokerIP1=shiji.rmq
   brokerIP2=172.17.88.54
   
   b0 broker.conf:
   brokerIP1=hsjl.rmq
   brokerIP2=172.17.88.57
   
   a1 broker.conf:
   brokerIP1=hsjl.rmq
   brokerIP2=172.17.88.57
   
   </pre>
   
   | - | 域名 | proxy端口 | broker端口 |
   |---|---|---|---|
   |a0| shiji.rmq | 15872| 15877|
   |b1| shiji.rmq | 15862| 15867|
   |b0| hsjl.rmq | 15852| 15857|
   |a1| hsjl.rmq |15842| 15847|
   
   
   
   客户端使用文档中示例代码:
   `String endpoints = "shiji.rmq:15872;shiji.rmq:15862;hsjl.rmq:15852;hsjl.rmq:15842";`
   
   返回的**TopicRouteData**
   <pre>
         ......
             {
                  "acceptMessageTypes": [
                       "NORMAL"
                  ],
                  "broker": {
                       "endpoints": {
                            "addresses": [
                                 {
                                      "address": "hsjl.rmq:15852",
                                      "host": "hsjl.rmq",
                                      "port": 15852
                                 }
                            ],
                            "facade": "ipv4:hsjl.rmq:15852",
                            "grpcTarget": "ipv4:hsjl.rmq:15852",
                            "scheme": "IPv4"
                       },
                       "id": 0,
                       "name": "broker-b"
                  },
                  "permission": "READ_WRITE",
                  "queueId": 31,
                  "topic": "standardQueue",
                  "topicResource": {
                       "name": "standardQueue",
                       "namespace": ""
                  }
             },
             {
                  "acceptMessageTypes": [
                       "NORMAL"
                  ],
                  "broker": {
                       "endpoints": {
                            "addresses": [
                                 {
                                      "address": "shiji.rmq:15852",
                                      "host": "shiji.rmq",
                                      "port": 15852
                                 }
                            ],
                            "facade": "ipv4:shiji.rmq:15852",
                            "grpcTarget": "ipv4:shiji.rmq:15852",
                            "scheme": "IPv4"
                       },
                       "id": 1,
                       "name": "broker-b"
                  },
                  "permission": "READ_WRITE",
                  "queueId": 0,
                  "topic": "standardQueue",
                  "topicResource": {
                       "name": "standardQueue",
                       "namespace": ""
                  }
             }
           ......
             {
                  "acceptMessageTypes": [
                       "NORMAL"
                  ],
                  "broker": {
                       "endpoints": {
                            "addresses": [
                                 {
                                      "address": "shiji.rmq:15852",
                                      "host": "shiji.rmq",
                                      "port": 15852
                                 }
                            ],
                            "facade": "ipv4:shiji.rmq:15852",
                            "grpcTarget": "ipv4:shiji.rmq:15852",
                            "scheme": "IPv4"
                       },
                       "id": 0,
                       "name": "broker-a"
                  },
                  "permission": "READ_WRITE",
                  "queueId": 31,
                  "topic": "standardQueue",
                  "topicResource": {
                       "name": "standardQueue",
                       "namespace": ""
                  }
             },
             {
                  "acceptMessageTypes": [
                       "NORMAL"
                  ],
                  "broker": {
                       "endpoints": {
                            "addresses": [
                                 {
                                      "address": "hsjl.rmq:15852",
                                      "host": "hsjl.rmq",
                                      "port": 15852
                                 }
                            ],
                            "facade": "ipv4:hsjl.rmq:15852",
                            "grpcTarget": "ipv4:hsjl.rmq:15852",
                            "scheme": "IPv4"
                       },
                       "id": 1,
                       "name": "broker-a"
                  },
                  "permission": "READ_WRITE",
                  "queueId": 0,
                  "topic": "standardQueue",
                  "topicResource": {
                       "name": "standardQueue",
                       "namespace": ""
                  }
             },
   ......
   </pre>
   
   
   
   ### What Did You Expect to See?
   
   a0,部署在甲服务器上,应该是`shiji.rmq:15872`;
   b1,部署在甲服务器上,应该是`shiji.rmq:15862`;
   b0,部署在乙服务器上,应该是`hsjl.rmq:15852`;
   a1,部署在乙服务器上,应该是`hsjl.rmq:15842`;
   
   
   ### What Did You See Instead?
   
   实际返回结果:
   a0:shiji.rmq:15852,
   b1:shiji.rmq:15852,
   b0:hsjl.rmq:15852,
   
   ### Additional Context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] bugCats commented on issue #6827: [Bug] 二副本对等部署,返回broker.endpoints.addresses有问题

Posted by "bugCats (via GitHub)" <gi...@apache.org>.
bugCats commented on issue #6827:
URL: https://github.com/apache/rocketmq/issues/6827#issuecomment-1566802634

   **补充一下**,我把2个从机停止了,并且使用内网IP调用,同样出现此类问题。
   2台服务器分别部署a0、b0,
   | - | IP| proxy端口 | 
   |---|---|---|
   |a0| 172.17.88.54| 15872|
   |b0| 172.17.88.57| 15852 | 
   
   
   但是客户端调用时,仍然返回
   <pre>
       ......
        {
             "acceptMessageTypes": [
                  "NORMAL"
             ],
             "broker": {
                  "endpoints": {
                       "addresses": [
                            {
                                 "address": "172.17.88.57:15872",
                                 "host": "172.17.88.57",
                                 "port": 15872
                            }
                       ],
                       "facade": "ipv4:172.17.88.57:15872",
                       "grpcTarget": "ipv4:172.17.88.57:15872",
                       "scheme": "IPv4"
                  },
                  "id": 0,
                  "name": "broker-b"
             },
             "permission": "READ_WRITE",
             "queueId": 31,
             "topic": "standardQueue",
             "topicResource": {
                  "name": "standardQueue",
                  "namespace": ""
             }
        },
        {
             "acceptMessageTypes": [
                  "NORMAL"
             ],
             "broker": {
                  "endpoints": {
                       "addresses": [
                            {
                                 "address": "172.17.88.54:15872",
                                 "host": "172.17.88.54",
                                 "port": 15872
                            }
                       ],
                       "facade": "ipv4:172.17.88.54:15872",
                       "grpcTarget": "ipv4:172.17.88.54:15872",
                       "scheme": "IPv4"
                  },
                  "id": 0,
                  "name": "broker-a"
             },
             "permission": "READ_WRITE",
             "queueId": 0,
             "topic": "standardQueue",
             "topicResource": {
                  "name": "standardQueue",
                  "namespace": ""
             }
        },  
       ......
   </pre>
   
   <br>
   
   这会导致`org.apache.rocketmq.client.java.impl.consumer.SimpleConsumerImpl#receive0`在挑选服务端IP端口时,获取到错误的地址:
   <pre>
           final ListenableFuture<SubscriptionLoadBalancer> routeFuture = getSubscriptionLoadBalancer(topic);
           final ListenableFuture<ReceiveMessageResult> future0 = Futures.transformAsync(routeFuture, result -> {
               final MessageQueueImpl mq = result.takeMessageQueue(); // result.messageQueues 会挑选到错误的proxy IP端口
               final ReceiveMessageRequest request = wrapReceiveMessageRequest(maxMessageNum, mq, filterExpression,
                   invisibleDuration, awaitDuration);
               return receiveMessage(request, mq, awaitDuration);
           }, MoreExecutors.directExecutor());   
   </pre>
   
   客户端控制会疯狂打印`finishConnect(..) failed: Connection refused: /172.17.88.57:15872`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org