Can acks=all cause production‑cluster failures when ISR shrinks?
0 reputation · 14 Oct 2020, 09:31 UTC
0 reputation · 14 Oct 2020, 09:31 UTC
Produce messages with full durability guarantees while keeping latency acceptable in a multi‑broker Kafka cluster.
The producer is configured with acks=all and a replication factor of 3. In a local single‑broker test the write succeeds quickly, but in production the producer sometimes times out or receives a NotEnoughReplicasException when a follower falls out of the ISR. The cluster also has a min.insync.replicas setting of 2.
It is unclear whether adjusting min.insync.replicas, changing the acks value, or tuning broker timeouts will resolve the issue without compromising durability.
NotEnoughReplicasException while preserving the durability promised by acks=all?acks to 1 eliminate the timeout problem, and if so, what is the trade‑off in terms of message loss?replica.lag.time.max.ms) be tuned to reduce ISR churn for a producer using acks=all?35275 reputation · 14 Oct 2020, 11:33 UTC
Yes. With acks=all the producer waits for acknowledgment from every broker that is currently in the ISR for a partition. If a follower falls out of the ISR, the ISR size drops. When the ISR size becomes smaller than min.insync.replicas, the broker returns NotEnoughReplicasException and the producer times out.
acks=all requires acknowledgment from all in‑sync replicas.replica.lag.time.max.ms.min.insync.replicas, the write succeeds; otherwise the broker rejects it with NotEnoughReplicasException.kafka-topics --describe or JMX metric kafka.server:type=ReplicaManager,name=IsrShrinkRate).min.insync.replicas (2 in your setup).replica.lag.time.max.ms, fix network/disk issues, or add brokers) so the follower can stay in sync.replica.lag.time.max.ms to give followers more time to catch up, monitoring that the value does not hide real lag.acks to 1 to avoid waiting for followers, accepting that a leader crash could lose the last un‑replicated message.To decide whether adjusting min.insync.replicas or follower lag tuning is appropriate, we need to know the observed ISR size when the NotEnoughReplicasException occurs. Please provide that value.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.