Uniform message distribution among partitions in tests #4920
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.
Cover letter
Provides option in KafkaCliTools to enforce round robin distribution of records among partitions. Kafka producers in new versions by default use sticky partitioning where records are sent to partition until batch size or linger.ms is reached, this may cause uneven distribution of records among partitions as seen in #4886 logs:
the data sent to partition 0 differs from data to partition 1 by a factor of 9. It results in SI never being triggered for partition 0 because the segment is never closed.
In tests where we want a roughly equal amount of data sent to partitions (eg to trigger SI uploads) we can use the roundrobin partitioner which ensures that each partition gets a roughly equal number of messages, at the cost of performance of producer.