bugfix kgo: do not default to eager if there is any eager balancer #384
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 previous cooperative check was wrong: if you used multiple group balancers, if any were eager, the client would think you were eager consuming.
However this bug did not affect all areas of group balancing, which actually made the bug worse. If everything in the code went eager, then the bug would just be "you saw more stop the world than was intended". Instead, if the chosen balancer was cooperative, then cooperative balancing would occur for eager consumers. On rebalance, partitions would be lost, and then a cooperative rebalance would not occur, meaning the partitions would be stuck until another rebalance.
We fix this by saving if we are cooperative based on the rebalancer that is actually chosen.
This is an upgrade path that should happen once -- once to cooperative -- but we can downgrade if the user adds a random eager balancer. This is not supported per KIP-429 so we just warn log and continue as best we can (likely with duplicate consumption).
Closes #366.