Kafka NOT_ENOUGH_REPLICAS: min.insync.replicas and acks=all
With acks=all, Kafka only confirms a write once enough in-sync replicas have it. If fewer brokers than min.insync.replicas are alive, producers are rejected rather than risking data loss.
What causes it
This is durability winning over availability by design. With replication factor 3 and min.insync.replicas 2, a topic survives one broker loss; lose a second broker and writes stop until a broker returns.
How to recognise it
- Producer errors NOT_ENOUGH_REPLICAS
- Under-replicated partitions before the errors start
- Consumers keep reading while producers fail
Error messages you will see
| Error | Seen in |
|---|---|
NOT_ENOUGH_REPLICAS | Apache Kafka, Amazon MSK, Azure Event Hubs, Redpanda |
How to fix it
- Restart brokers
- Run more brokers than the replication factor
- Lower min.insync.replicas (less durable)
Reproduce it in the simulator
Open the simulator, build a small architecture and use Fault injection in the inspector, or push traffic past a component’s capacity.
Learn more
Part of the guide Message queues vs event streams.