Luke Chen created KAFKA-16283:
---------------------------------

             Summary: RoundRobinPartitioner will only send to half of the 
partitions in a topic
                 Key: KAFKA-16283
                 URL: https://issues.apache.org/jira/browse/KAFKA-16283
             Project: Kafka
          Issue Type: Bug
            Reporter: Luke Chen


When using `org.apache.kafka.clients.producer.RoundRobinPartitioner`, we expect 
data are send to all partitions in round-robin manner. But we found there are 
only half of the partitions got the data. This causes half of the 
resources(storage, consumer...) are wasted.


{code:java}
bin/kafka-topics.sh --create --topic quickstart-events4 --bootstrap-server 
localhost:9092 --partitions 2 

Created topic quickstart-events4.

bin/kafka-producer-perf-test.sh --topic quickstart-events4 --num-records 10 
--record-size 100 --throughput -1 --producer-props 
bootstrap.servers=localhost:9092 
partitioner.class=org.apache.kafka.clients.producer.RoundRobinPartitioner

10 records sent, 72.463768 records/sec (0.01 MB/sec), 35.10 ms avg latency, 
132.00 ms max latency, 24 ms 50th, 132 ms 95th, 132 ms 99th, 132 ms 99.9th.

lukchen@lukchen-mac kafka % ls -al /tmp/kafka-logs/quickstart-events4-0
total 24
drwxr-xr-x   7 lukchen  wheel       224  2 20 19:53 .
drwxr-xr-x  70 lukchen  wheel      2240  2 20 19:53 ..
-rw-r--r--   1 lukchen  wheel  10485760  2 20 19:53 00000000000000000000.index
-rw-r--r--   1 lukchen  wheel      1151  2 20 19:53 00000000000000000000.log
-rw-r--r--   1 lukchen  wheel  10485756  2 20 19:53 
00000000000000000000.timeindex
-rw-r--r--   1 lukchen  wheel         8  2 20 19:53 leader-epoch-checkpoint
-rw-r--r--   1 lukchen  wheel        43  2 20 19:53 partition.metadata
lukchen@lukchen-mac kafka % ls -al /tmp/kafka-logs/quickstart-events4-1
total 8
drwxr-xr-x   7 lukchen  wheel       224  2 20 19:53 .
drwxr-xr-x  70 lukchen  wheel      2240  2 20 19:53 ..
-rw-r--r--   1 lukchen  wheel  10485760  2 20 19:53 00000000000000000000.index
-rw-r--r--   1 lukchen  wheel         0  2 20 19:53 00000000000000000000.log
-rw-r--r--   1 lukchen  wheel  10485756  2 20 19:53 
00000000000000000000.timeindex
-rw-r--r--   1 lukchen  wheel         0  2 20 19:53 leader-epoch-checkpoint
-rw-r--r--   1 lukchen  wheel        43  2 20 19:53 partition.metadata
{code}




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

Reply via email to