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 2020/06/09 16:36:52 UTC

[GitHub] [pulsar] AnkushKhanna opened a new issue #7217: In Key_Shared subscription with stickyHashRange allow hashes in between

AnkushKhanna opened a new issue #7217:
URL: https://github.com/apache/pulsar/issues/7217


   **Is your feature request related to a problem? Please describe.**
   In `Key_Shared` subscription using `stickyHashRange`, consumers interleaving hashes are not allowed. For example, consumer 1 hash: [[0, 99], [400, 65535]], consumer 2 hash: [[100,399]].
   throws an exception, `Range conflict with consumer` from [here](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/HashRangeExclusiveStickyKeyConsumerSelector.java#L109).
   This does not allow us to use better hashing techniques ex: **consistent hashing**.
   Is this a necessary check?
   
   **Describe the solution you'd like**
   Avoid the check if this is not necessary. 
   
   **Additional context**
   I am not sure if this is a feature or a bug. Reporting as a feature, please feel free to change accordingly. 
   To reproduce the error, you can create two consumers with 
   ```java
   client.newConsumer(Schema.STRING)
                ....
                .subscriptionType(SubscriptionType.Key_Shared)
               .keySharedPolicy(KeySharedPolicy.stickyHashRange().ranges(Range.of(0,99), Range.of(400, 65535)))
               .subscribe();
   ```
   ```java
   client.newConsumer(Schema.STRING)
                ....
                .subscriptionType(SubscriptionType.Key_Shared)
               .keySharedPolicy(KeySharedPolicy.stickyHashRange().ranges(Range.of(100,399)))
               .subscribe();
   ```


----------------------------------------------------------------
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] sijie commented on issue #7217: In Key_Shared subscription with stickyHashRange allow hashes in between

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


   @AnkushKhanna I think you have identified the problem. It would be great if you can send out a pull request to fix the problem and add some tests to cover this corner cases.


----------------------------------------------------------------
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] AnkushKhanna commented on issue #7217: In Key_Shared subscription with stickyHashRange allow hashes in between

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


   I would love to contribute. Let me know if I can help.


----------------------------------------------------------------
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] codelipenghui closed issue #7217: In Key_Shared subscription with stickyHashRange allow hashes in between

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


   


----------------------------------------------------------------
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] sijie commented on issue #7217: In Key_Shared subscription with stickyHashRange allow hashes in between

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


   @AnkushKhanna This sounds like a bug. Thank you for reporting the issue. 


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