-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[consumer] Add rack-awareness (KIP-881) to assignors #4252
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
milindl
force-pushed
the
dev_kip_881_range_assignor
branch
from
May 16, 2023 09:43
c349b5d
to
3f50a9d
Compare
Rebased onto latest protocol changes. |
milindl
force-pushed
the
dev_kip_881_range_assignor
branch
from
May 16, 2023 09:59
3f50a9d
to
b10cf3d
Compare
milindl
changed the title
[consumer] Add rack-awareness (KIP-881) to range assignor
[consumer] Add rack-awareness (KIP-881) to assignors
May 18, 2023
It would be a great change! |
emasab
reviewed
May 19, 2023
milindl
pushed a commit
that referenced
this pull request
May 25, 2023
milindl
force-pushed
the
dev_kip_881_range_assignor
branch
from
June 5, 2023 09:01
b273fd9
to
ba26721
Compare
* [cooperative][manual commit] Prevent offsets from being committed when a rebalance is in progress and partitions are owned by consumer * Add test * Format * Ensure the operation is thread safe * Add missing test config * Don't propagate results if we decide to skip committing * fixing broken test * fixing typo * Add rack-awareness (KIP-881) to sticky-assignor * Fix minor issues with commiting only when not rebalancing * memory leak in test * test naming * test copyright * Fix style and remove rd_list_add_const --------- Co-authored-by: Roxane Fruytier <[email protected]> Co-authored-by: William Morgan <[email protected]> Co-authored-by: William Morgan <[email protected]>
milindl
force-pushed
the
dev_kip_881_range_assignor
branch
from
June 5, 2023 09:12
3d3efe6
to
fb2c94f
Compare
emasab
reviewed
Jun 7, 2023
emasab
reviewed
Jun 7, 2023
milindl
force-pushed
the
dev_kip_881_range_assignor
branch
from
June 8, 2023 03:38
3f06e7a
to
8a31959
Compare
emasab
approved these changes
Jun 9, 2023
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! Amazing job @milindl !
7 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds on the protocol change PR to add rack awareness to the Range Assignor.
I understand that this is quite a large PR, here are the main changes:
rd_kafka_range_assignor_assign_cb
and its call tord_kafka_topic_assignment_state_new
form the entry points of the assignment algorithm, and should probably be seen first. The code is based on the AK RangeAssignor.java and it is recommended to keep that open.rd_kafka_range_assignor_unittest
. Almost all the tests within RangeAssignorTest.java have been converted, except a few.For sticky assignor:
Start with rd_kafka_sticky_assignor_assign_cb. They match, almost completely, with the Java changes to AbstractStickyAssignor.java in this PR.. Additionally, a struct matching RackInfo in the Java implementation, is added.
There are, what I think are two pre-existing bugs in the implementation that I found while porting tests. They are marked in the commit itself as a comment (I will remove the comment after first round of reviews).
Unit test addition: tests missing or different from AbstractStickyAssignorTest.java are added, existing tests are parametrized to include rack cases (rack consumer, rack brokers, rack both).
Some refactoring of common functions across assignors and unit tests into rdkafka_assignor.h/c to avoid duplication.