Skip to content

In Key_Shared subscription with stickyHashRange allow hashes in between #7217

Closed

Description

@AnkushKhanna

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

client.newConsumer(Schema.STRING)
             ....
             .subscriptionType(SubscriptionType.Key_Shared)
            .keySharedPolicy(KeySharedPolicy.stickyHashRange().ranges(Range.of(0,99), Range.of(400, 65535)))
            .subscribe();
client.newConsumer(Schema.STRING)
             ....
             .subscriptionType(SubscriptionType.Key_Shared)
            .keySharedPolicy(KeySharedPolicy.stickyHashRange().ranges(Range.of(100,399)))
            .subscribe();

Activity

  1. added
    type/feature
    on Jun 9, 2020
  2. sijie commented on Jun 10, 2020

    @sijie
    Member

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

  3. added
    type/bug
    and removed
    type/feature
    on Jun 10, 2020
  4. AnkushKhanna commented on Jun 10, 2020

    @AnkushKhanna
    Author

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

  5. sijie commented on Jun 10, 2020

    @sijie
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/brokertype/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions