You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/05/15 09:36:37 UTC

[GitHub] [rocketmq] coder-zzzz opened a new issue #1999: Order message invalid in extreme scenario

coder-zzzz opened a new issue #1999:
URL: https://github.com/apache/rocketmq/issues/1999


   sort queuedata list action in client module, but if some client (like python or c++) doesn't implement the sort method, then the producer select messagequeue to send message will not effective.
   https://github.com/coder-zzzz/rocketmq/blob/master/docs/en/Example_Orderly.md
   For example: 
   1. There is tow nameserver:ns1,ns2, two broker: broker1,broker2, two producer:p1,p2, topicA has two queue :q0,q1, and topicaA create in both brokers.
   2. Broker1 and broker2 startup together, register  to ns in the order:  broker1-->ns1,broker2-->ns2, broker1-->ns2,broker2-->ns1.
   3. Then in ns1's topicQueueTable's queueDataList will be broker1-q0,broker1-q1,broker2-q0, broker2-q1, ns2's topicQueueTable's queueDataList will be broker2-q0,broker2-q1,broker1-q0, broker1-q1.
   4. P1 connect to ns1, p2 connect to ns2, their MessageQueueSelector's select method will select different result when the args is same.
   ```java
   SendResult sendResult = producer.send(msg, new MessageQueueSelector() {
                   @Override
                   public MessageQueue select(List<MessageQueue> mqs, Message msg, Object arg) {
                       Long id = (Long) arg;  //message queue is selected by #salesOrderID
                       long index = id % mqs.size();
                       return mqs.get((int) index);
                   }
               }, orderList.get(i).getOrderId());
   ```
   Imagine this :mqs.size both equals 4, and index equals 0,p1 select broker1-q0, p2 select broker2-q0.
   
   So I think it is better to sort queueDataList in nameserver instead of client.
   


----------------------------------------------------------------
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.

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



[GitHub] [rocketmq] lebron374 edited a comment on issue #1999: Order message invalid in extreme scenario

Posted by GitBox <gi...@apache.org>.
lebron374 edited a comment on issue #1999:
URL: https://github.com/apache/rocketmq/issues/1999#issuecomment-629548258


   i think rocketmq not  promise to do this,even sort in namesrv still exist this problem ,because producer or consumer may not pull connfig from the same namesrv.
   
   
   


----------------------------------------------------------------
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.

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



[GitHub] [rocketmq] lebron374 commented on issue #1999: Order message invalid in extreme scenario

Posted by GitBox <gi...@apache.org>.
lebron374 commented on issue #1999:
URL: https://github.com/apache/rocketmq/issues/1999#issuecomment-629548258


   i think rocketmq not  promise to do sth,even sort in namesrv still exist this problem ,because producer or consumer may not pull connfig from the same namesrv.
   
   
   


----------------------------------------------------------------
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.

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



[GitHub] [rocketmq] coder-zzzz commented on issue #1999: Order message invalid in extreme scenario

Posted by GitBox <gi...@apache.org>.
coder-zzzz commented on issue #1999:
URL: https://github.com/apache/rocketmq/issues/1999#issuecomment-629921246


   > i think rocketmq not promise to do this,even sort in namesrv still exist this problem ,because producer or consumer may not pull connfig from the same namesrv.
   
   I know it is not promise by rocketmq. Except the network problems, it can be the same routeInfo  when sort in namesrv even through producer and consumer pull config from different namesrv


----------------------------------------------------------------
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.

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