You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/31 09:44:28 UTC

[GitHub] [pulsar] mantuliu opened a new issue #10750: Consumer cannot consume messages when key_shared mode

mantuliu opened a new issue #10750:
URL: https://github.com/apache/pulsar/issues/10750


   **Describe the bug**
   Key_shared mode is configured as ConsistentHashingStickyKeyConsumerSelector, When I use three consumers with the same consumerName, if one consumer is closed, the other two consumers will no longer be able to consume messages.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. config the 'conf/standalone.conf'
      ```
       subscriptionKeySharedUseConsistentHashing=true
      ```
   2. ./bin/pulsar standalone
   3. Start 3 consumers with the same cosumerName.
   ```
           PulsarClient client = PulsarClient.builder()
                   .serviceUrl("pulsar://localhost:6650")
                   .build();
   
           org.apache.pulsar.client.api.Consumer consumer = client.newConsumer()
                   .topic("my-topic")
                   .subscriptionName("my-subscription")
                   .consumerName("one")
                   .subscriptionType(SubscriptionType.Key_Shared)
                   .subscribe();
   ```
   4. Start a producer send messages.
   5. All 3 consumers can consume messages.
   6. Close one consumer, and the producer send messages again.
   7. **The other two consumers cannot consume new messages**
   
   **Expected behavior**
   The other two consumers can continue to consume new messages(Refer to step 7 above).
   
   
   **Additional context**
   https://github.com/apache/pulsar/blob/e19f6472183ac93dc058a96f7ac0537c22d90e18/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ConsistentHashingStickyKeyConsumerSelector.java#L93
   
   I think the problem is due to the above code, which removes all consumers with the same name.


-- 
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] [pulsar] merlimat commented on issue #10750: Consumer cannot consume messages when key_shared mode and subscriptionKeySharedUseConsistentHashing

Posted by GitBox <gi...@apache.org>.
merlimat commented on issue #10750:
URL: https://github.com/apache/pulsar/issues/10750#issuecomment-1023412417


   @sourcelliu @lhotari
   
   > Perhaps this is related to #13965 ?
   
   No, it's not related to that (and #13965 is just a test issue, not a code issue).
   
   The consumer name is expected to be unique (eg: if you don't pass one, it will be auto-generated). 
   
   Having said that, the check here is wrong, as we should compare the consumer instance and not just the name.


-- 
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@pulsar.apache.org

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



[GitHub] [pulsar] codelipenghui closed issue #10750: Consumer cannot consume messages when key_shared mode and subscriptionKeySharedUseConsistentHashing

Posted by GitBox <gi...@apache.org>.
codelipenghui closed issue #10750:
URL: https://github.com/apache/pulsar/issues/10750


   


-- 
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@pulsar.apache.org

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



[GitHub] [pulsar] lhotari commented on issue #10750: Consumer cannot consume messages when key_shared mode and ConsistentHashingStickyKeyConsumerSelector

Posted by GitBox <gi...@apache.org>.
lhotari commented on issue #10750:
URL: https://github.com/apache/pulsar/issues/10750#issuecomment-1023083268


   Perhaps this is related to #13965 ?


-- 
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@pulsar.apache.org

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