-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle hash collision in KeyShared subscription mode #8396
Conversation
@jiazhai @codelipenghui PTAL |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
@ltamber Could you please add some unit test for the new change? |
@codelipenghui It seem that hard to simulate(but it does exist) hash collision when use murmur_3, so I just run the |
/pulsarbot run-failure-checks |
…pache#8396) ### Motivation Currently, in `ConsistentHashingStickyKeyConsumerSelector` key consumer selector,if multi key have the same hash code, the consumer in the `hashRing` will be replaced by the newer consumer, so the behavior of the message dispatch will not consistent if the consumer subscribed in a different order. ### Modifications handle the hash collision with a list. ### Verifying this change unit test `ConsistentHashingStickyKeyConsumerSelectorTest` was passed.
…pache#8396) ### Motivation Currently, in `ConsistentHashingStickyKeyConsumerSelector` key consumer selector,if multi key have the same hash code, the consumer in the `hashRing` will be replaced by the newer consumer, so the behavior of the message dispatch will not consistent if the consumer subscribed in a different order. ### Modifications handle the hash collision with a list. ### Verifying this change unit test `ConsistentHashingStickyKeyConsumerSelectorTest` was passed.
} | ||
|
||
return consumerList.get(hash % consumerList.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ltamber I have a question about this line of code in #23315 (comment) . Are you available to answer that question? Thanks /cc @codelipenghui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a change already, #23327
Motivation
Currently, in
ConsistentHashingStickyKeyConsumerSelector
key consumer selector,if multi key have the same hash code, the consumer in thehashRing
will be replaced by the newer consumer, so the behavior of the message dispatch will not consistent if the consumer subscribed in a different order.Modifications
handle the hash collision with a list.
Verifying this change
unit test
ConsistentHashingStickyKeyConsumerSelectorTest
was passed.