-
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
[improve][broker][PIP-379] Improve hash collision handling by restoring consumer when other leaves #23447
[improve][broker][PIP-379] Improve hash collision handling by restoring consumer when other leaves #23447
Conversation
…ng consumer when other leaves
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23447 +/- ##
============================================
+ Coverage 73.57% 74.28% +0.71%
- Complexity 32624 34374 +1750
============================================
Files 1877 1940 +63
Lines 139502 146929 +7427
Branches 15299 16186 +887
============================================
+ Hits 102638 109146 +6508
- Misses 28908 29350 +442
- Partials 7956 8433 +477
Flags with carried forward coverage won't be shown. Click here to find out more.
|
...c/main/java/org/apache/pulsar/broker/service/ConsistentHashingStickyKeyConsumerSelector.java
Show resolved
Hide resolved
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.
LGTM
…ng consumer when other leaves (apache#23447)
Fixes #23443
Motivation
In the current ConsistentHashingStickyKeyConsumerSelector implementation, when there's a hash ring point collision,
the original entry will be preserved and the attempted addition will be rejected.
This isn't a problem with the consumerNameIndexTracker solution since the collisions won't align for all hash ring points when using the same consumer name. Because of this, collisions won't affect the overall distribution significantly when the number of hash ring points is sufficiently large (>100).
However, when the "selected" consumer is removed, the colliding consumer should be selected and take over it's hash ring point. This PR implements that logic.
Modifications
Documentation
doc
doc-required
doc-not-needed
doc-complete