create new topic-partition list comparison method based on hashing #5014
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.
the new method is much faster than the old, O(Na + Nb) compared to the older one, which is O(Na * Nb)
Background:
The old one was causing problems with partition counts ~3600 in the cooperative-sticky partition assignment.
The group leader ended up being kicked out of the group because he spent too much time calculating the partition assignment, and didn't sent any heartbeat inbetween.
reducing the complexity of this pushes the runtime down. Concrete example with 3600 partitions and 1800 consumers before: ~240s
after: ~3s
fixes problem in #4629
I have tried to stick to the styles, but ran into problems with getting the right version of clang-format (10 doesn't seem to be available via homebrew)
I have have also run the unit tests, they pass.
I am currently running 0113-cooperative-rebalance.cpp test case.
I'm not sure if I should be completely replacing the old comparison function, but happy to do so based on comments