Skip to content
Kafka Is FunProgress

Beginner5 min

Leader Failover Recovery

Observe and understand leader election when a broker fails mid-write.

When a partition's leader broker fails, Kafka must elect a new leader from the ISR. Producers detect this via a NOT_LEADER_OR_FOLLOWER error and automatically refresh metadata and retry. This lab demonstrates the full failure-recovery cycle.

The steps below reference the interactive simulator, which is being migrated into /simulate next — until it lands, treat this as the written runbook for the exercise.

Steps

0 of 7 steps completed

Verification

After restart, ISR should show 3/3 for all partitions. The metadata cache should show fresh entries pointing to the correct leaders.

The interview angle

This is the most common Kafka interview scenario. Key answer: producer auto-retries after metadata refresh. With enable.idempotence=true, retries produce no duplicates.