Video in progress
acks=all is set, but a message was still lost when a broker went down. What role does min.insync.replicas play here?
acks=all waits only for the replicas currently in the ISR. If only the leader is left in the ISR, "all" means a single copy. With min.insync.replicas=2, the broker rejects writes when the ISR shrinks, so a message never ends up on just one copy.
📖 Answer
Scenario: RF=3, min.insync.replicas=1 (the default). Two followers dropped out of the ISR because of slow disks. The producer writes with acks=all: the leader wrote it, nobody else is in the ISR, and the answer is "OK". Then the leader's disk dies. Nobody else stored the message.
The right combination:
# topic or broker level
replication.factor=3
min.insync.replicas=2
# producer
acks=all
Now if the ISR drops to 1, the producer gets a NotEnoughReplicasException (retriable). This reduces write availability, but it prevents silent loss.
Why not min.insync.replicas=3? Then even a rolling restart of one broker stops writes. RF=3 / min ISR=2 is the balance that survives losing one broker.
One subtle point: min.insync.replicas only works with acks=all. Producers with acks=1 never notice this restriction. So you also need to know who is writing to the cluster with which acks.
Sign up to mark studied questions and save your progress.