When Kafka send acknowledgement if acks=all and all replicas are healthy?
Asked Answered
C

1

4

Let the Kafka producer is configured with acks=all and there are 5 broker replicas with min.insync.replica=2 configuration.

I understand that if 3 brokers go offline, but 2 brokers are still up and healthy, then the producer will still get the message acknowledgement and will be able to continue sending the messages.

But what happens if all 5 brokers are up and healthy:

  • #1 Will the producer receive the acknowledgement only after all 5 brokers write the message to themselves?
  • #2 Or will the producer already receive the acknowledgement after 2 brokers write the message? So it will not wait for the feedback from the remaining other 3 brokers?

I am interesting in the throughput in the case when all broker replicas are healthy: will the throughput with min.insync.replica=2 will be higher then with min.insync.replica=5 (for acks=all and  5 broker replicas)?

Cudgel answered 26/11, 2022 at 7:37 Comment(0)
W
4

Producer will get the acknowledgement the moment data in written to min.insync.replicas that is 2 in this case. It will not wait for all brokers to get the message. And yes, the throughput will definitely be higher when min.insync.replica=2

That is the tradeoff kafka is trying to give the user. If throughput is critical for you, keep min.insync.replica lower, but if reliability is more critical to you keep min.insync.replica higher.

Whithersoever answered 26/11, 2022 at 8:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.