I read about Kafka replication protocol. I found that Kafka maintains LEO and HW. As I understood,
LEO: Offset of latest message a replica has seen.
HW: Offset of the latest message which is guaranteed that each replica has seen.
Kafka producer can be set to these acknowledgement methods.
So my question is how the leader advances the HW depending on the acknowledgment method Kafka producer uses.
What I understood was,
for acks = 0, Leader advances the HW when it sees a new message.
for acks = 1, Leader advances the HW when it wrote new message to its local log.
for acks = all, Leader advances HW when each an every follower sent ack that they got the message.
Is this correct? Can anyone clarify this?
With further exploring, I found that there is no relation between HW advancement and acknowledgment method set in broker configurations. Regardless of what is set to acks, the leader replica waits for all the other followers to persist the message before advancing the HW.