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

Update Kafka client version and change partition assignor #769

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

tomncooper
Copy link
Contributor

@tomncooper tomncooper commented Feb 7, 2023

NOTE: Since this PR was posted the confluent-kafka version has already been updated, but the config change to use cooperative rebalancing in the consumer is still an important change.

💸 TL;DR

This PR updates the confluent kafka client version, which brings bug fixes and support for newer Kafka versions and features. It also updates the default partition assignor used by the Kafka consumers to use the "cooperative sticky" assigner, which is the recommended, faster option.

📜 Details

While Kafka servers are backwards compatible with older client versions, new features are limited to newer client versions so it is important to keep you clients up to date. Also, newer clients are backwards compatible with older server so there should not be any compatibility concerns. This, along with the obvious advantages of bug and performance fixes (including Mac M1 support) that come with new versions, makes this upgrade worthwhile.

The new client version also allows new configuration options. The newer consumer clients can use the "cooperative sticky" assignor (see KIP-726 for more details) which dramatically speeds up consumer group rebalances (by only changing partitions of consumers that have stopped rather that potentially shuffling the partitions of every consumer). This should make baseplate.py kafka consumer applications more stable.

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo

@tomncooper tomncooper requested a review from a team as a code owner February 7, 2023 15:18
# Use the cooperative sticky assignor for consumer group rebalances.
# This *dramatically* reduces the time taken to rebalance the consumer group
# when the underlying topic metadata changes (leadership changes etc).
"partition.assignment.strategy": "cooperative-sticky",
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like this will change how things work for existing consumers. Will it make things better in all cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once they restart their consumer applications they will use this new assignment strategy. It will only be triggered on a consumer group rebalance. If that happens they will see a much quicker rebalance as fewer partitions will be reassigned between consumers. So, yes, we should see an across the board improvement.

@KTAtkinson KTAtkinson added the v2.6 Pull requests to be included in v2.6 label Apr 4, 2023
@tomncooper
Copy link
Contributor Author

@KTAtkinson Since this PR was posted the confluent-kafka version has already been updated, but the config change to use cooperative rebalancing in the consumer is still an important change.

What do we need to do to get this merged?

Copy link
Member

@chriskuehl chriskuehl left a comment

Choose a reason for hiding this comment

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

(copy-pasting same comment from #761)

I'm planning to release a baseplate 2.6.0 final version in the next couple days (and I'd like to avoid adding any more changes to this already-large release). After that, I think it'd be a good time to start working through the backlog of baseplate PRs to see what can be merged. Let's plan to merge this in a few days once 2.6.0 is out?

@bjk-reddit bjk-reddit added v2.7 and removed v2.6 Pull requests to be included in v2.6 labels Apr 8, 2024
@bjk-reddit bjk-reddit merged commit 0863f67 into reddit:develop Apr 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants