Monedula

Scenario 00.2.1 · LEO vs high watermark

Kafka high watermark vs log end offset (LEO)

Anatomy · Intermediate · about 2 min · Apache Kafka 4.3

LEO is each replica’s log end; the high watermark is the committed line = min(LEO) across the ISR.

Run this scenario in the playground

Leader's LEO races ahead · HW still 0. t+0.900s

Three records are appended to the leader, so its LEO is 3. The followers, paced by a slow replica fetch, are still at 0. The high watermark = min(LEO) across the ISR = 0, so nothing is committed yet.

Open at this step: step 2, Leader's LEO races ahead · HW still 0

What you start with

Each replica has a log-end offset (LEO) - the next position it will write - while the high watermark is the committed line, equal to the smallest LEO across the ISR. With followers fetching on a delay, watch the leader’s LEO run ahead of the high watermark until the replicas catch up.

Step by step

  1. Idle · LEO = HW = 0 t+0.000s One partition, three replicas. Every replica's log end offset (LEO) and the high watermark (HW) start at 0. Open at this step: step 1, Idle · LEO = HW = 0
  2. Leader's LEO races ahead · HW still 0 t+0.900s Three records are appended to the leader, so its LEO is 3. The followers, paced by a slow replica fetch, are still at 0. The high watermark = min(LEO) across the ISR = 0, so nothing is committed yet. Open at this step: step 2, Leader's LEO races ahead · HW still 0
  3. Followers caught up · HW = 3 t+1.300s The followers fetched the three records, so every replica's LEO is 3. With all ISR members caught up, the high watermark advances to 3 - all three records are now committed. Open at this step: step 3, Followers caught up · HW = 3

The takeaway

A record is committed only once every in-sync replica has it: the high watermark = min(LEO) over the ISR is what makes a write durable, not the leader’s LEO alone.

Embed this scenario

Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.

<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=00.2.1" title="Kafka Simulator: LEO vs high watermark" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/leo-vs-hw/">Kafka high watermark vs log end offset (LEO)</a></p>

Further reading

Apache Kafka documentation

More in Anatomy

All scenarios