[ https://issues.apache.org/jira/browse/KAFKA-9965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chia-Ping Tsai resolved KAFKA-9965. ----------------------------------- Resolution: Won't Fix onNewBatch is removed from 4.0 so I'm going to close this jira > Uneven distribution with RoundRobinPartitioner in AK 2.4+ > --------------------------------------------------------- > > Key: KAFKA-9965 > URL: https://issues.apache.org/jira/browse/KAFKA-9965 > Project: Kafka > Issue Type: Bug > Components: producer > Affects Versions: 2.4.0, 2.5.0, 2.4.1 > Reporter: Michael Bingham > Priority: Major > > {{RoundRobinPartitioner}} states that it will provide equal distribution of > records across partitions. However with the enhancements made in KIP-480, it > may not. In some cases, when a new batch is started, the partitioner may be > called a second time for the same record: > [https://github.com/apache/kafka/blob/2.4/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L909] > [https://github.com/apache/kafka/blob/2.4/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L934] > Each time the partitioner is called, it increments a counter in > {{RoundRobinPartitioner}}, so this can result in unequal distribution. > Easiest fix might be to decrement the counter in > {{RoundRobinPartitioner#onNewBatch}}. > -- This message was sent by Atlassian Jira (v8.20.10#820010)