min.insync.replicas — Kafka Broker Configuration
When a producer sets acks to "all" (or "-1"), this configuration specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).
Description
When a producer sets acks to "all" (or "-1"), this configuration specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of "all". This will ensure that the producer raises an exception if a majority of replicas do not receive a write.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.9.0 | 1 |
| 0.10.0 | 1 |
| 0.10.1 | 1 |
| 0.10.2 | 1 |
| 0.11.0 | 1 |
| 1.0 | 1 |
| 1.1 | 1 |
| 2.0 | 1 |
| 2.1 | 1 |
| 2.2 | 1 |
| 2.3 | 1 |
| 2.4 | 1 |
| 2.5 | 1 |
| 2.6 | 1 |
| 2.7 | 1 |
| 2.8 | 1 |
| 3.0 | 1 |
| 3.1 | 1 |
| 3.2 | 1 |
| 3.3 | 1 |
| 3.4 | 1 |
| 3.5 | 1 |
| 3.6 | 1 |
| 3.7 | 1 |
| 3.8 | 1 |
| 3.9 | 1 |
| 4.0 | 1 |
| 4.1 | 1 |
| 4.2 | 1 |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| broker / durability | 2 | With default.replication.factor=3 and min.insync.replicas=2, a ProduceRequest with acks=all is acknowledged only after 2 out of 3 replicas confirm the write. This guarantees that even if 1 broker fails immediately after the ack, the data is safe on the remaining 2. |
Related Configs
acks · replica.lag.time.max.ms · default.replication.factor · unclean.leader.election.enable · offsets.topic.replication.factor · auto.create.topics.enable