IntermediateOperations
How would you debug a 'LEADER_NOT_AVAILABLE' error in production?
Reference answer
This error means the requested partition has no elected leader. Debug steps: 1) Check if the partition is under-replicated (kafka-topics.sh --describe). 2) Check broker health — is the leader broker up? 3) Check if ISR count dropped below min.insync.replicas causing leader to step down. 4) Check controller logs for election activity. 5) Check for network partitions between brokers. 6) Verify sufficient ISR size: kafka-log-dirs.sh can show replica offsets. Usually self-resolves once the failed broker recovers or another ISR member is elected. Temporary error — producer should retry.
Expected key concepts: under-replicated, partition, broker health, ISR, min.insync.replicas, controller, network partition, replica offsets, temporary, retry