Leader rebalancing restores a partition’s preferred leader after a broker returns or leadership has shifted. A returning broker first synchronizes as an in-sync follower; it may later reclaim leadership automatically or require a manual election. section 5.3
Use the following operational sequence:
- Confirm that the recovered broker has rejoined the ISR and that replicas are synchronized. section 5.3
- Trigger preferred elections with kafka-leader-election.sh when automatic rebalancing is not configured or has not occurred. section 5.3
- Avoid unclean elections except in an extreme emergency, because an out-of-sync replica may lack messages and cause data loss. section 5.3
Restoring a preferred leader
For products.prices.changelog.replication-3, Broker 3 returns and becomes an ISR follower for Partition 1. Running kafka-leader-election.sh with --election-type=preferred and --all-topic-partitions moves leadership back to Broker 3.
