Skip to content
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] Don't replace a consumer when there's a collision #23441

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Oct 11, 2024

Fixes #23439

Motivation

When a consumer joins or leaves, the hash ranges from existing consumers shouldn't move from one to another.

Modifications

  • Revisit adding the to hash ring so that existing consumers aren't replaced when there are collisions.
  • Add a test case which ensures this

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Copy link
Contributor

@equanz equanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 56.25000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 74.23%. Comparing base (bbc6224) to head (cc54bf8).
Report is 667 commits behind head on master.

Files with missing lines Patch % Lines
...ce/ConsistentHashingStickyKeyConsumerSelector.java 53.33% 5 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23441      +/-   ##
============================================
+ Coverage     73.57%   74.23%   +0.66%     
- Complexity    32624    34431    +1807     
============================================
  Files          1877     1953      +76     
  Lines        139502   147189    +7687     
  Branches      15299    16206     +907     
============================================
+ Hits         102638   109272    +6634     
- Misses        28908    29472     +564     
- Partials       7956     8445     +489     
Flag Coverage Δ
inttests 27.65% <56.25%> (+3.07%) ⬆️
systests 24.35% <37.50%> (+0.03%) ⬆️
unittests 73.60% <56.25%> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...roker/service/ConsumerHashAssignmentsSnapshot.java 83.00% <100.00%> (ø)
...ce/ConsistentHashingStickyKeyConsumerSelector.java 92.15% <53.33%> (-2.08%) ⬇️

... and 636 files with indirect coverage changes

@lhotari lhotari merged commit 390d7d9 into apache:master Oct 11, 2024
56 of 59 checks passed
@lhotari lhotari modified the milestones: 4.1.0, 4.0.0 Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug][PIP-379] Hash ranges should not move from one consumer to another when a consumer joins
4 participants