You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Stephane Maarek (Jira)" <ji...@apache.org> on 2023/01/04 20:16:00 UTC

[jira] [Created] (KAFKA-14573) RoundRobinPartitioner doesn't work as expected with topic that has 6 partitions

Stephane Maarek created KAFKA-14573:
---------------------------------------

             Summary: RoundRobinPartitioner doesn't work as expected with topic that has 6 partitions
                 Key: KAFKA-14573
                 URL: https://issues.apache.org/jira/browse/KAFKA-14573
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 3.3.1
            Reporter: Stephane Maarek
         Attachments: image-2023-01-04-20-15-43-039.png

Create a topic with 6 partitions (that's how the behavior is observed)
```
kafka-topics.sh --bootstrap-server localhost:9092 --topic test_topic --create --partitions 6
```

Start a consumer
```
kafka-console-consumer --bootstrap-server localhost:9092 --topic test_topic --formatter kafka.tools.DefaultMessageFormatter --property print.timestamp=true --property print.key=true --property print.value=true --property print.partition=true --from-beginning
```

Start a producer using `RoundRobinPartitioner`
```
kafka-console-producer.sh --bootstrap-server localhost:9092 --producer-property partitioner.class=org.apache.kafka.clients.producer.RoundRobinPartitioner --topic test_topic
```

And you will see only 3 partitions get produced to (not 6)

This doesn't happen with 3 partitions, 5, 7, 9 partitions (we get the expected behavior).

But with 6.... it happens.

Verified to be like this on my colleague's computer too. 

 !image-2023-01-04-20-15-43-039.png! 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)