Skip to content
Kafka Is Fun

ScenarioProduction Scenarios

Your Kafka cluster shows UnderReplicatedPartitions > 0. Walk through your debugging steps.

Reference answer

UnderReplicatedPartitions counts partitions where the ISR is smaller than the full replica set (kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions; the normal value is 0). Step 1: run kafka-topics.sh --describe --under-replicated-partitions to see which partitions are affected and which replicas are missing from the ISR. Step 2: check whether the missing replicas share one broker and whether that broker is alive and healthy. Step 3: check that broker's logs for errors (disk I/O errors, long GC pauses, out-of-memory, network problems). Step 4: use kafka-log-dirs.sh --describe to see the size and offsetLag of each replica on the brokers. Step 5: check free disk space and whether any log directory is offline. Step 6: check the network between brokers. Step 7: remember that a follower is removed from the ISR if it has not sent fetch requests, or has not caught up to the leader's log end offset, for replica.lag.time.max.ms (default 30000 ms), so slow disks, network or GC pauses longer than that cause it. Step 8: if GC pauses are the cause, review the JVM settings (the Apache docs list example G1 settings). Resolution: fix the root cause; once the follower catches up it rejoins the ISR and the metric returns to 0.

Expected key concepts: kafka-topics.sh, under-replicated-partitions, ISR, GC pauses, disk space, kafka-log-dirs.sh, offsetLag, replica.lag.time.max.ms, UnderReplicatedPartitions

How did that feel?

Your own verdict, not the score. It shows up next to this question in the list, so you can come back to the shaky ones.