Skip to content
Kafka Is FunProgress

Lesson 1 of 5

Leader Election Protocol

Every partition has exactly one leader at a time. The leader handles all produce and fetch requests. Followers replicate by sending FetchRequests to the leader. When a leader fails, the controller elects a new leader — always from the ISR. If the ISR is empty and unclean.leader.election.enable=false (default), the partition goes offline. This prevents data loss by refusing to elect a stale replica.

Key configuration

broker / client configurationproperties
unclean.leader.election.enable=false — never elect out-of-ISR leaders (recommended)
leader.imbalance.check.interval.seconds=300 — auto rebalance interval

Try it in the simulator

Guided scenarios for this module — the simulator opens with the exercise already running.