Scrivio Interview library
ConceptFoundations6 min read · updated 13 November 2026

A partition has replication factor 3. The leader's log end offset is 1,050, follower A is at 1,040 and follower B at 1,046, and both are in the ISR.

What is the high watermark, which offsets can a consumer read, and why does Kafka hide the rest?

The high watermark is the offset up to which every in-sync replica has the data: the smallest log end offset among ISR members, here 1,040 from follower A. Consumers can read offsets 0 to 1,039; offsets 1,040 to 1,049 exist on the leader but are hidden. Kafka hides them because they are not yet on every ISR replica, so if the leader failed now a new leader might not have them, and a consumer could have read records that then disappear.

Why this question is asked

Every Kafka guarantee about what is committed rests on the high watermark, so it shows up in questions about durability, consumer lag, acks=all and transactions. Interviewers ask this simple-looking question to see whether we understand the difference between data the leader has and data the cluster has committed, and why that difference must be invisible to consumers. In this answer, we will recap log end offsets and the ISR, compute the high watermark for our partition, see why Kafka hides the rest, see how the leader learns the followers' positions, and connect it to acks=all and to read_committed consumers.

1A Quick Recap of Log End Offsets and the ISR

Each replica of a partition has a log end offset, or LEO: the offset that the next record appended to it will get. A LEO of 1,050 means the replica holds offsets 0 to 1,049. The leader receives writes first, so its LEO is usually the highest, and followers trail it by a little as they fetch.

The in-sync replica set, or ISR, is the set of replicas that are keeping up with the leader. A follower stays in the ISR as long as it catches up to the leader's log end within replica.lag.time.max.ms (30 seconds by default). Being in the ISR is what makes a replica eligible to become leader under normal settings. In our partition all three replicas are in the ISR: the leader at 1,050, A at 1,040 and B at 1,046.

2Computing the High Watermark

The high watermark, or HW, is the smallest LEO among the ISR members. Every record below it is present on every in-sync replica. For our partition that is min(1,050, 1,040, 1,046), which is 1,040. So offsets 0 to 1,039 are committed, and offsets 1,040 to 1,049 are on the leader, and some of them on B, but not yet on A.

Who holds which offsets
ReplicaLog end offsetHolds offsetsMissing
Leader1,0500 - 1,049none
Follower B1,0460 - 1,0451,046 - 1,049
Follower A1,0400 - 1,0391,040 - 1,049
High watermark1,040consumers read 0 - 1,0391,040 and up hidden
The slowest in-sync replica sets the high watermark.

Consumers can only fetch up to the high watermark. A consumer at offset 1,035 receives records 1,035 to 1,039 and then waits. Its reported lag is measured against the high watermark too, so tools would show it as caught up even though the leader has ten more records. As A fetches records 1,040 and onward, the high watermark moves up and those records become visible.

3Why Kafka Hides Everything Above It

Imagine the leader crashes right now. The controller elects a new leader from the ISR, and it might pick A, which has only offsets up to 1,039. Offsets 1,040 to 1,049 would not exist in the new leader's log. When the old leader comes back, it truncates its log to match the new leader, so those records are gone everywhere, and new records written to A will reuse offsets 1,040 onward.

If a consumer had already read offset 1,045 before the crash, it would hold a record that the log no longer contains, and the next record it sees at offset 1,045 could be a completely different one. Its committed offset would point into a log that changed under it. By never exposing anything above the high watermark, Kafka makes sure that every record a consumer sees will still be there, at the same offset, after any clean leader election. That is the real meaning of committed in Kafka: not 'written to the leader' but 'on every in-sync replica'.

4How the Leader Learns the Followers' Positions

Followers replicate by sending fetch requests to the leader, the same kind of request consumers send. Each fetch says 'give me data starting at offset X', and X is the follower's current LEO. So the leader learns each follower's position for free from its fetches; there is no separate acknowledgement message.

When a fetch shows that the slowest ISR member has moved forward, the leader advances the high watermark. It sends the new high watermark back in fetch responses, so followers learn it on their next fetch, which means a follower's own high watermark lags the leader's slightly. That lag is harmless for reads, because consumers read from the leader, or from a follower that only serves up to the high watermark it knows.

Step throughA record becoming visible
ProducerLeaderFollower AConsumer
produce offset 1,040 (acks=all)
fetch from offset 1,040
record 1,040
fetch from offset 1,041 (A now has 1,040)
HW advances to 1,041
ack for offset 1,040
fetch from 1,040
record 1,040 is now visible

8 messages in order. Play them, or step through them one at a time.

The follower's next fetch position is its acknowledgement.

5The Connection to acks=all and Transactions

A producer with acks=all is acknowledged when every current ISR member has the record. That is exactly the moment the high watermark passes it. So an acks=all acknowledgement and consumer visibility happen at the same point: once a producer is told a record is safe, consumers can read it, and not before. With acks=1 the leader acknowledges as soon as it has written the record locally, before the high watermark reaches it, which is why acks=1 records can be lost in a failover without any consumer ever having seen them.

For consumers with isolation.level=read_committed there is a second limit, the last stable offset, or LSO. It is the offset of the first record that belongs to a still-open transaction, or the high watermark if there is none. Such a consumer reads only up to the LSO, so a long-running open transaction can hold it back even further than the high watermark.

6Follow-up questions

Does a slow follower in the ISR hold back the high watermark?

Yes, while it stays in the ISR. That is why acks=all latency follows the slowest in-sync follower. If the follower falls behind for longer than replica.lag.time.max.ms, the leader removes it from the ISR, and the high watermark is then computed from the remaining members.

What happens to the high watermark if the ISR shrinks to just the leader?

Then the high watermark is the leader's own log end offset, and with acks=all the leader acknowledges after writing locally. That is why min.insync.replicas exists: with it set to 2, acks=all writes are refused when the ISR shrinks to one, instead of quietly accepting records that live on a single broker.

Can consumers read from followers?

Yes, with follower fetching, configured with replica.selector.class on brokers and client.rack on consumers. A follower serves only up to the high watermark it knows, so a consumer reading from a follower may see records slightly later than one reading from the leader, but never a record that is not committed.

7Conclusion

In this answer, we saw that the high watermark is the smallest log end offset among in-sync replicas, 1,040 in our example, so consumers can read offsets up to 1,039. Kafka hides everything above it because a new leader might not have those records, and exposing them could show consumers records that later vanish or get replaced at the same offset. The leader learns follower positions from their fetches, an acks=all acknowledgement happens exactly when the high watermark passes a record, and read_committed consumers are further limited by the last stable offset.

What to say in the interviewAbout 90 seconds aloud

Open with

The high watermark is the boundary of what the partition has committed. It is the smallest log end offset among the in-sync replicas, so here it is the minimum of 1,050, 1,040 and 1,046, which is 1,040.

Then, if they want more

Every offset below that is on all three replicas, so consumers can read up to offset 1,039, and offsets 1,040 to 1,049 exist on the leader but are not visible yet. Kafka hides them because if the leader died right now, the controller could elect follower A, which does not have them.

The old leader would truncate when it came back, those records would be gone, and new records would reuse the same offsets. A consumer that had already read them would hold data that no longer exists and offsets that now mean something else.

The leader knows where each follower is because followers replicate by fetching, and each fetch says which offset they need next, so when the slowest ISR member moves forward, the leader moves the high watermark and passes it to followers in fetch responses.

This lines up with acks=all: the producer gets its acknowledgement exactly when every ISR member has the record, which is when the high watermark passes it. And for read_committed consumers the limit is the last stable offset, which an open transaction can hold back further.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Kafka documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "What is the high watermark, which offsets can a consumer read, and why does Kafka hide...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-internals/13f4da4228/