Replication and the ISR

Kafka · lesson 8 of 34 · 3 min read

Understand leaders, followers and the in-sync replica set that decides whether a write survives.

Open this lesson in the learning hub

Key points

  • Every partition has one leader and N-1 followers. All reads and writes go through the leader.
  • Followers that keep up form the ISR, the in-sync replicas. Fall behind by replica.lag.time.max.ms (30s) and you drop out.
  • Only records replicated to the full ISR are committed and visible to consumers. That boundary is the high watermark.
  • Leaders are elected from the ISR. unclean.leader.election.enable=false (the default) refuses stale leaders: availability traded for zero loss.
  • Replication factor 3 is the standard: lose one broker and you still write safely with min.insync.replicas=2.

Example

# Partitions that can no longer satisfy min.insync.replicas
kafka-topics.sh --bootstrap-server localhost:9092 \
  --describe --under-min-isr-partitions

# Partitions missing replicas (early warning)
kafka-topics.sh --bootstrap-server localhost:9092 \
  --describe --under-replicated-partitions

# Set the durability floor for one topic
kafka-configs.sh --bootstrap-server localhost:9092 \
  --alter --entity-type topics --entity-name orders \
  --add-config min.insync.replicas=2

A shrinking ISR is your earliest warning that durability is already at risk.

This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the Kafka course, and every lesson in it is listed on the Kafka contents page.