Kafka Partition Assignment and acks Practice

Free Kafka practice for the Confluent CCDAK and CCAAK: say which consumer gets which partition under RangeAssignor or RoundRobinAssignor, or whether a write succeeds for a given replication factor, min.insync.replicas, acks and set of failed brokers. Check my answer names the slip, such as dealing round robin when the assignor is range or applying min.insync.replicas to acks=1.

Practise

Group and topics

Answer to see the working.

Groups, topics and brokers are made up for practice. Consumer names stand for member ids, with no racks and no static membership, and unclean leader election stays off, the default.

Practise the exams

Confluent describes the CCDAK as the exam for developers who build applications with Apache Kafka and the CCAAK as the exam for people who manage Kafka clusters. Start with the free real exam questions, then get the full pack.

Confluent CCDAK89 real exam questions · US$39
Free: 22 questionsGet the full pack
Confluent CCAAK109 real exam questions · US$39
Free: 21 questionsGet the full pack

Kafka FAQ

How does RangeAssignor assign partitions?

One topic at a time. For each topic it lays out the partitions in numeric order and the consumers in lexicographic order, divides the partitions by the number of consumers, and gives the first few consumers one extra partition when the division is not even. With consumers C0 and C1 and topics t0 and t1 of 3 partitions each, C0 gets t0p0, t0p1, t1p0 and t1p1, and C1 gets t0p2 and t1p2. That is the example in the Kafka javadoc.

How does RoundRobinAssignor assign partitions?

It lays out all the partitions of all the topics and all the consumers, then deals the partitions to the consumers one at a time. With the same two consumers and two topics, C0 gets t0p0, t0p2 and t1p1, and C1 gets t0p1, t1p0 and t1p2. When every consumer has the same subscriptions, the counts differ by one at most.

Why is a consumer idle when there are enough partitions?

Because RangeAssignor splits each topic on its own. With three consumers and two topics of 2 partitions each, C0 and C1 take one partition of each topic and C2 gets nothing, although there are 4 partitions. RoundRobinAssignor would deal the same 4 partitions across all three consumers.

What happens in round robin when subscriptions differ?

The assignor still takes each consumer in turn, but skips a consumer that is not subscribed to the topic, so the result can be uneven. In the javadoc example, C0 subscribes to t0, C1 to t0 and t1, and C2 to all three topics, with 1, 2 and 3 partitions. C0 gets t0p0, C1 gets t1p0, and C2 gets t1p1, t2p0, t2p1 and t2p2.

What does min.insync.replicas do?

When a producer sets acks to all (or -1), it is the minimum number of replicas that must acknowledge a write for the write to succeed. If the in-sync replica set is smaller than that, the producer gets a NotEnoughReplicas or NotEnoughReplicasAfterAppend exception. The typical set-up in the Kafka documentation is a replication factor of 3, min.insync.replicas of 2 and acks of all.

Does min.insync.replicas apply with acks=1?

No. The Kafka design documentation says the setting only takes effect if the producer uses acks=all. With a less strict acks setting a message can be committed and consumed even if the number of in-sync replicas is below the minimum, as low as just the leader.

With acks=all, how many replicas must have the record?

Every replica that is in sync at that moment, which is not always every assigned replica and not just min.insync.replicas of them. If a topic has a replication factor of 3 and all three replicas are in sync, all three must acknowledge the write, even if min.insync.replicas is lower. If one of two replicas has failed, an acks=all write still succeeds with min.insync.replicas of 1.

What is the difference between acks=0, acks=1 and acks=all?

With acks=0 the producer does not wait for any acknowledgment. With acks=1 the leader writes the record to its own log and answers without waiting for the followers, so the record is lost if the leader fails before they copy it. With acks=all the leader waits for the full set of in-sync replicas, and the record is not lost as long as one in-sync replica stays alive. acks=-1 means the same as acks=all.

What happens when a broker that holds a replica goes down?

It is removed from the in-sync replica set. If it was the leader, an in-sync replica takes over after a short fail-over. If every replica is down, the partition stays unavailable until an in-sync replica comes back, because by default Kafka does not let an out-of-sync replica become leader.

Sources
  • Apache Kafka 3.9 javadoc, RangeAssignor: per topic, partitions in numeric order, consumers in lexicographic order, the first few consumers take one extra partition, and the worked example with C0 and C1.
  • Apache Kafka 3.9 javadoc, RoundRobinAssignor: all partitions and all consumers laid out, round robin from partition to consumer, a consumer skipped when it is not subscribed to the topic, and the three worked examples.
  • Apache Kafka 3.9 documentation, Topic configs (min.insync.replicas), Producer configs (acks) and Consumer configs (partition.assignment.strategy).
  • Apache Kafka 3.9 documentation, Design, sections on replication, unclean leader election and availability and durability guarantees: a dead follower leaves the ISR, the minimum ISR size only takes effect with acks=all, and a partition with no live replica stays unavailable.
  • Confluent Platform documentation, Topic configuration reference (min.insync.replicas: every in-sync replica must acknowledge an acks=all write) and Producer configuration reference (acks).
  • Exam fit: Confluent, Confluent Certification (CCDAK and CCAAK descriptions).
  • Checked 20 November 2026: the drill reproduces the four worked examples in the javadoc, and an independent solver that reads only the exhibit and the question agreed with it on 12,000 generated problems. Left out because these pages give no exact rule: RangeAssignor with different subscriptions, the sticky and cooperative sticky assignors, rack-aware assignment, static membership, round robin cases where two readings of "skips" would differ, acks=0, and an acks=all write when no in-sync replica is left. This is an independent practice tool, not made or endorsed by Confluent or the Apache Software Foundation.

Checked 20 November 2026 against the Apache Kafka 3.9 javadoc and documentation and the Confluent Platform configuration reference.

More free tools

All free tools