CCDAK practice question 3 of 25

To get acknowledgement of writes to only the leader partition, we need to use the config...

Full set: 150 questions
Answer options
A: acks=1 Correct answer
B: acks=0
C: acks=all
Correct Answer:
A. acks=1
Explanation

The producer configuration acks=1 ensures that the producer receives an acknowledgement after the leader replica has successfully written the record to its own log. The leader responds to the producer's request without waiting for the follower replicas to replicate the data. This setting provides a balance between durability and latency, confirming that the message was received by the broker leader, but not guaranteeing it has been replicated for fault tolerance. This is the default setting for Kafka producers.

Why Incorrect

B. acks=0: This setting means the producer will not wait for any acknowledgement from the broker. The record is sent and immediately considered successful, offering the lowest latency but no delivery guarantees.
C. acks=all: This setting provides the highest durability. The producer waits for the leader to acknowledge the write after all in-sync replicas (ISRs) have also successfully replicated the record.

References

1. Confluent Documentation, Producer Configs, acks:

"acks=1 This will mean the leader will write the record to its local log but will respond without awaiting full acknowledgement from all followers. In this case should the leader fail immediately after acknowledging the record but before the followers have replicated it then the record will be lost."

Source: Confluent Documentation, Section: acks, https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#producerconfigsacks

2. Apache Kafka Documentation, 3.4 Producer Configs, acks:

"acks=1: This means the leader will write the record to its local log but will respond without awaiting full acknowledgement from all followers."

Source: Apache Kafka Documentation, Section: 3.4 Producer Configs, https://kafka.apache.org/documentation/#producerconfigsacks

3. Kleppmann, M. (2017). Designing Data-Intensive Applications. O'Reilly Media.

Chapter 11, Page 410, discusses replication and leader-based protocols. It explains that waiting for acknowledgement from the leader only (acks=1) confirms the write to one node but doesn't guarantee durability if that node fails before replication completes. This aligns with the behavior described for acks=1.

Scroll to Top