Kafka topic config
min.insync.replicas: the floor for acks=all writes
min.insync.replicas is the fewest in-sync replicas, leader included, that must have a write for an acks=all produce to succeed (default 1). When the ISR is smaller, the leader rejects acks=all writes with NOT_ENOUGH_REPLICAS. It has no effect on acks=0 or acks=1 producers, or on consumers.
- Config
min.(topic)insync. replicas - Default
- 1
- Valid values
- 1 or more
- Also set at
- Also a broker setting, min.insync.replicas, which is the default for topics that do not set it.
What it does
An acks=all producer waits until every replica in the ISR has the record. On its own, that could mean only the leader if the followers have fallen out of the ISR. min.insync.replicas puts a floor under it: with the ISR below the floor, the leader refuses the write instead of accepting a record that would live on too few brokers. The error is retriable, so the producer keeps retrying until the ISR recovers or delivery.timeout.ms runs out.
The trade-off
A higher value means every acknowledged record is on more brokers, but fewer brokers can be down before acks=all producers stop. With replication.factor=3, min.insync.replicas=2 tolerates one broker down for writes and guarantees two copies; 3 would block writes during any broker restart; 1 keeps writing with a single copy, so losing that broker loses data.
Advice
- Use replication.factor=3 with min.insync.replicas=2 and acks=all as the baseline for data you cannot lose.
- Never set it equal to the replication factor: every rolling restart then blocks writes.
- Alert on under-min-ISR partitions; they are refusing writes from acks=all producers right now.
See it in the simulator
- min.insync.replicas with acks=all: when Kafka refuses writes (min.ISR boundary) Step 6: O3 blocked - NotEnoughReplicas Open at this step: min.insync.replicas with acks=all: when Kafka refuses writes
- Kafka acks=0 vs acks=1 vs acks=all on a degraded ISR (acks trade-off) Step 4: acks=all produce blocked - NotEnoughReplicas Open at this step: Kafka acks=0 vs acks=1 vs acks=all on a degraded ISR