liveBook · Manning

In-sync replica

As explained in Kafka Streams in Action, Second Edition

An in-sync replica set is the set of Kafka partition replicas that are sufficiently caught up with the partition leader to remain eligible for failover.

An in-sync replica (ISR) is a follower replica whose log has caught up with its partition leader closely enough to remain eligible for leadership if the leader fails. Kafka uses replication to keep partition data available across brokers. section 2.9.1

Track an ISR through the replication flow:

  • The leader appends producer records to its partition log. section 2.9.1
  • Follower brokers fetch those records from the leader and append matching data and offsets to their own logs. section 2.9.1
  • A follower becomes an ISR member when it is fully caught up; replica.lag.time.max.ms removes it after excessive fetch or catch-up delay. section 2.9.1
  • Consumers read only through the high-water mark, the latest offset stored by all in-sync replicas. section 2.9.1

A brief replication gap

After a producer sends a batch, the leader may temporarily contain records that followers have not copied. That short lag is normal; persistent lag can remove a follower from the ISR and reduce failover choices. section 2.9.1

Figure 2.15 Followers must issue a fetch request or be caught up within the lag time configuration.
figure

Use the replication-lag diagram to see how fetch timing and the lag configuration determine ISR membership. section 2.9.1

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Defines follower catch-up, lag-based removal, leader election, and high-water-mark behavior without implementing broker internals.
Examples
Uses leader-follower log copying, temporary post-producer lag, and configured follower delays.
What it assumes
Assumes basic Kafka brokers, topics, partitions, leaders, followers, and producer records.
What you can do after
Evaluate which replicas can replace a failed Kafka partition leader and why consumers avoid unreplicated records.
How it connects
Connects partition leaders, follower replicas, Kafka replication, high-water marks, and replica.lag.time.max.ms.

Also explained in

Compare how 3 books explain in-sync replica →

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.