Kafka Error REPLICA_NOT_AVAILABLE
Error code 9 · Retriable Broker
The replica is not available for the requested topic-partition. Produce/Fetch requests and other requests intended only for the leader or follower return NOT_LEADER_OR_FOLLOWER if the broker is not a replica of the topic-partition.
Common Causes
- One or more replica brokers are down or lagging so far behind the leader that they have been removed from the ISR
- Ongoing partition reassignment leaving the replica in a transitional state before it fully catches up
- Broker hosting the replica is under heavy disk I/O load causing replica fetch lag to exceed 'replica.lag.time.max.ms'
Solutions
- Identify which replicas are offline: kafka-topics.sh --describe --under-replicated-partitions; restart the lagging broker or investigate its disk/network health
- Tune 'replica.lag.time.max.ms' (default 30000ms) and 'replica.fetch.max.bytes' to give slow replicas more time and bandwidth to catch up before being evicted from ISR
- Check broker logs for replica fetcher errors and verify network connectivity between brokers
Diagnostic Commands
# Check for under-replicated partitions
kafka-topics.sh --describe --bootstrap-server localhost:9092 --under-replicated-partitions
# Check replica offset lag and status
kafka-log-dirs.sh --bootstrap-server localhost:9092 --broker-list <broker-id> --describe | grep -E 'offsetLag|isFuture'
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.