liveBook · Manning

High-water mark

As explained in Kafka Streams in Action, Second Edition

A high-water mark is the greatest partition offset replicated to all in-sync replicas and made accessible to consumers.

The high-water mark is the greatest partition offset stored by every in-sync replica. Kafka exposes consumers only to records at or below this boundary, preventing recently read records from disappearing after a replica failure. section 2.9.1

Pending replication at offsets 8–10

If offsets 8–10 exist on the leader but have not reached every in-sync replica, offset 7 is the high-water mark. Consumers can read through 7; if the leader fails, the producer receives no acknowledgment for the unavailable records and retries them. section 2.9.1

Use the high-water mark alongside these related boundaries:

  • In a nontransactional environment, the last stable offset equals the high-water mark, so consumers can poll through it. section 4.4.3
  • With transactions, read_committed consumers stop at the last stable offset, which may be below the high-water mark while a transaction remains open. section 4.4.3
Figure 4.24 High water mark vs. last stable offset in a transactional environment
figure

Compare the high-water mark with the last stable offset in a transactional environment. section 4.4.3

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Defines the replication boundary, works through offsets 8–10, and contrasts it with the transactional last stable offset.
Examples
Uses offsets 8–10 awaiting replication and contrasts nontransactional polling with read_committed polling.
What it assumes
Assumes partition replication, leaders, followers, in-sync replicas, offsets, and basic producer-consumer behavior.
What you can do after
Configure consumers with read_committed while distinguishing replication durability from transactional visibility.
How it connects
Connects replicas, in-sync replicas, consumers, producer acknowledgments, transactions, and the last stable offset.

Also explained in

Compare how 2 books explain high-water mark →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.