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

Add rack-awareness (KIP-881) to sticky-assignor #4274

Merged
merged 15 commits into from
May 18, 2023

Conversation

milindl
Copy link
Contributor

@milindl milindl commented May 9, 2023

This builds on the protocol change PR to add rack awareness to the Sticky Assignor.

I understand that this is quite a large PR, here are the main changes:

  1. 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.

  2. 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).

  3. 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).

  4. Some refactoring of common functions across assignors and unit tests into rdkafka_assignor.h/c to avoid duplication.

@milindl milindl requested review from emasab and pranavrth May 9, 2023 06:01
@milindl milindl force-pushed the dev_kip_881_sticky_assignor branch from da687ac to a1e35a9 Compare May 9, 2023 09:31
@wmorgan6796
Copy link

@milindl would it be possible to pull in #4220 into this? or as part of a smaller PR in addition to this? @emasab mentioned that there was work being done on stick assignor and I'm hoping we can get the fix from #4220 in so that the sticky assignor won't be broken anymore (for manual commits).

@milindl
Copy link
Contributor Author

milindl commented May 10, 2023

Hi @wmorgan6796 , yep, that makes sense, @emasab discussed it internally as well. I'll add your commit from #4220 into this so it might get in as well. Thanks

@ZhukovAntonPls
Copy link

Hi @wmorgan6796 , yep, that makes sense, @emasab discussed it internally as well. I'll add your commit from #4220 into this so it might get in as well. Thanks

This is an excellent improvement. We also really need her.

@spalax
Copy link

spalax commented May 12, 2023

+1

@votar1408
Copy link

It would be a great change!

@milindl milindl force-pushed the dev_kip_881_range_assignor branch 2 times, most recently from 3f50a9d to b10cf3d Compare May 16, 2023 09:59
@milindl milindl force-pushed the dev_kip_881_sticky_assignor branch from a1e35a9 to 86d22e7 Compare May 18, 2023 04:09
@milindl milindl merged commit 06855fc into dev_kip_881_range_assignor May 18, 2023
@milindl milindl deleted the dev_kip_881_sticky_assignor branch May 18, 2023 04:39
@milindl
Copy link
Contributor Author

milindl commented May 18, 2023

Merged this into the branch dev_kip_881_range_assignor for review. Includes @wmorgan6796 's changes.

milindl added a commit that referenced this pull request Jun 5, 2023
* [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 added a commit that referenced this pull request Jun 5, 2023
* [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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants