[consumer] Add rack-awareness (KIP-881) to assignors#4252
Merged
Milind L (milindl) merged 15 commits intomasterfrom Jun 10, 2023
Merged
[consumer] Add rack-awareness (KIP-881) to assignors#4252Milind L (milindl) merged 15 commits intomasterfrom
Milind L (milindl) merged 15 commits intomasterfrom
Conversation
c349b5d to
3f50a9d
Compare
Contributor
Author
|
Rebased onto latest protocol changes. |
3f50a9d to
b10cf3d
Compare
|
It would be a great change! |
Milind L (milindl)
pushed a commit
that referenced
this pull request
May 25, 2023
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]>
3d3efe6 to
fb2c94f
Compare
3f06e7a to
8a31959
Compare
Emanuele Sabellico (emasab)
approved these changes
Jun 9, 2023
Contributor
Emanuele Sabellico (emasab)
left a comment
There was a problem hiding this comment.
LGTM! Amazing job Milind L (@milindl) !
7 tasks
3 tasks
This file contains hidden or 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
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_cband its call tord_kafka_topic_assignment_state_newform 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.