liveBook · Manning

Under-replicated partition

As explained in Apache Kafka in Action

An under-replicated partition is a Kafka partition that currently has fewer replicas than its configured replication requirement.

An under-replicated partition has fewer active replicas than its configured replication factor. It usually signals that a broker is unavailable or a replica has fallen out of sync, reducing redundancy until recovery completes. section 5.3 section 15.6

Use the partition and ISR state to distinguish replication loss from an immediate availability failure:

  • Run kafka-topics.sh --describe --under-replicated-partitions to find affected partitions across topics. section 5.3
  • Compare Replicas with Isr: a missing replica makes the partition under-replicated, while the remaining in-sync replicas may still support continued operation. section 5.3
  • Check under-minimum-ISR status separately; an under-replicated partition can still retain enough ISRs to satisfy min.insync.replicas. section 5.3
  • After the failed broker returns, allow its replica to synchronize before treating redundancy as restored; preferred-leader reassignment is a separate step. section 5.3

A broker failure in a three-replica topic

The products.prices.changelog.replication-3 topic uses replication factor 3 and min.insync.replicas=2. When Broker 3 stops, its partitions show Replicas containing three brokers but Isr containing only Brokers 1 and 2. The partitions are therefore under-replicated, yet two ISRs remain. After Broker 3 restarts and catches up, it rejoins the ISR; a preferred-leader election can then restore it as leader where required.

How Apache Kafka in Action covers it

How deep it goes
Explains replica and ISR differences through broker failure and recovery, but defers detailed rules for ISR membership and leader eligibility.
Examples
Demonstrates a three-broker products.prices.changelog.replication-3 topic before failure, during Broker 3 downtime, and after recovery.
What it assumes
Assumes basic Kafka topics, partitions, brokers, replicas, and leaders while introducing their relationship through commands and failure scenarios.
What you can do after
Diagnose with kafka-topics.sh, distinguish insufficient replication from insufficient ISRs, and verify recovery after a broker returns.
How it connects
Connects replication factor, in-sync replicas, min.insync.replicas, broker failure, leader election, and preferred leaders.

Also explained in

Compare how 2 books explain under-replicated partition →

Related concepts

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