Skip to content

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

Merged
Milind L (milindl) merged 15 commits intodev_kip_881_range_assignorfrom
dev_kip_881_sticky_assignor
May 18, 2023
Merged

Add rack-awareness (KIP-881) to sticky-assignor#4274
Milind L (milindl) merged 15 commits intodev_kip_881_range_assignorfrom
dev_kip_881_sticky_assignor

Conversation

@milindl
Copy link
Copy Markdown
Contributor

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.

@wmorgan6796
Copy link
Copy Markdown

Milind L (@milindl) would it be possible to pull in #4220 into this? or as part of a smaller PR in addition to this? Emanuele Sabellico (@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
Copy Markdown
Contributor Author

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

@neuralspin
Copy link
Copy Markdown

Hi William Morgan (@wmorgan6796) , yep, that makes sense, Emanuele Sabellico (@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
Copy Markdown

+1

@votar1408
Copy link
Copy Markdown

It would be a great change!

@milindl Milind L (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 Milind L (milindl) force-pushed the dev_kip_881_sticky_assignor branch from a1e35a9 to 86d22e7 Compare May 18, 2023 04:09
@milindl Milind L (milindl) merged commit 06855fc into dev_kip_881_range_assignor May 18, 2023
@milindl Milind L (milindl) deleted the dev_kip_881_sticky_assignor branch May 18, 2023 04:39
@milindl
Copy link
Copy Markdown
Contributor Author

Merged this into the branch dev_kip_881_range_assignor for review. Includes William Morgan (@wmorgan6796) 's changes.

Milind L (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]>
Milind L (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