-
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
assignor: API for a custom consumer group assignment strategy #3812
base: master
Are you sure you want to change the base?
assignor: API for a custom consumer group assignment strategy #3812
Conversation
@@ -49,14 +49,6 @@ | |||
*/ | |||
|
|||
|
|||
/** @brief Assignor state from last rebalance */ |
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.
It seems like this state is not used ... so I removed altogether to simplify "public" interface.
38d272b
to
cc3d4c5
Compare
cc3d4c5
to
bf5680e
Compare
Interesting,
and in the OSX env:
EDIT: it does not pass in Appveyor only, it passes windows build in Travis CI |
bf5680e
to
e8cb829
Compare
This is fixed, commit is squashed, the issues was in this loop where I relied on the order, but the array might be manipulated by the caller (sort, etc.). Why it was failing only in EDIT: I've found the root cause. In This raises a question: should |
e8cb829
to
066e7f6
Compare
@edenhill are you interested in this PR? |
64c57df
to
df6c72a
Compare
I can't reproduce style check failure with |
df6c72a
to
52af26c
Compare
Hello @scanterog @niamster sorry for the long wait. I want to point out that with KIP-881 the range assignor is being changed to co-partitioned (same partition numbers to the same members, given topics with same partition count) and rack-aware, also with KIP-848 the range assignor will be co-partitioned, rack-aware and sticky. The assignment will be done by the group coordinator. The two properties: co-partitioned and sticky allow to create joins in a way similar to what Kafka Streams does, with local cache. Given this roadmap, would it be enough for Datadog's needs? If there's something else that cannot be done without a customer assignor please comment. Also, I'd like to know from other people about kinds of assignors they're thinking to, other than the cases already listed in #2284 |
Hi @emasab! Thanks for checking this. We need a way to compute the assignment logic on the client side and as far as I understood KIP-848 supports that.
Co-partitioned is great when you have a balanced traffic across all partitions. In our case, we want to compute the assignment in order to address the issue of imbalanced partitions. On the client-side assignor we can measure the load on each partition (by using external signals) and based on that distribute the load evenly across the group members which does not necessarily translate to the same number of partitions to each member. |
Thanks, that's an interesting use case and you can't handle it with manual assignment because it's not static and that'll mean losing the "transactional" property of consumer group assignments. |
Please let us know if you need further information. If you can also provide the estimate you have came across that would useful for us, thanks again @emasab. |
This addresses #2284
Exported API is sufficient enough to implement existing assignment strategies and allow users define their own.
This PR does not change how rebalance works, it reworks existing API so it can be accessible via
<librdkafka/rdkafka.h>
.Some structures are split into "internal" and "public" to minimise the amount of changes. The conversion from one to another is done just before the callbacks are called.
Open questions:
_v0
or_exp
suffix to functions and structures?rd_kafka_assignor_register
function. I would prefer to bass it viard_kafka_t
but I don't have a strong opinion.NOTE: there are some changes related to formatting. I have setup my editor to automatically call clang-format on save with a given (default repository) configuration.