Kafka Error NEW_LEADER_ELECTED
Error code 108 · Non-retriable Broker
The AlterPartition request successfully updated the partition state but the leader has changed.
Common Causes
- A leader election occurred concurrently while an AlterPartition request was in-flight, causing the broker to reject the stale update since a new leader already took over.
- Controlled shutdown or broker failure during partition reassignment triggers simultaneous leader changes, causing in-flight metadata updates to land on an outdated partition state.
- High controller churn (frequent controller failovers in KRaft or ZooKeeper mode) produces race conditions between multiple AlterPartition requests.
Solutions
- This error is informational for controller-side partition state changes — a newer leader already won. No client action is required; verify via `kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --status` that the metadata quorum is stable.
- Reduce controller instability by checking controller GC pauses, network partitions, and quorum health instead of repeatedly retrying the same leader change under churn.
- Audit reassignment plans to avoid concurrent AlterPartition storms — stagger partition reassignments using `kafka-reassign-partitions.sh` with small batch sizes rather than bulk operations.
Diagnostic Commands
# Check KRaft metadata quorum status
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 --command-config admin.properties describe --status
# Look for leader election events in logs
grep 'NEW_LEADER_ELECTED\|AlterPartition\|leader election' /var/log/kafka/server.log | tail -100Related APIs
This error can be returned by: AlterPartition
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.