Learn about unclean leader election and the availability vs durability trade-off in 10 minutes When no in-sync replicas (ISRs) are available, Kafka has to decide between staying unavailable or promoting an out-of-sync replica to leader. TheDocumentation Index
Fetch the complete documentation index at: https://docs.conduktor.io/llms.txt
Use this file to discover all available pages before exploring further.
unclean.leader.election.enable configuration controls this critical trade-off.
What you’ll learn:
- What unclean leader election means
- When unclean elections cause data loss
- Use cases where enabling this setting makes sense
- How to configure unclean leader election
Clean vs unclean leader election
When the leader for a partition becomes unavailable, one of the in-sync replicas (ISR) becomes the new leader. This is a “clean” election because committed data exists on all ISRs by definition. But what happens when no ISR exists except for the failed leader?| Option | Behavior | Risk |
|---|---|---|
| Wait for ISR (default) | Topic unavailable until ISR recovers | Availability loss |
| Unclean election | Promote out-of-sync replica | Data loss |
The availability vs durability trade-off
If we allow out-of-sync replicas to become leaders, we will have data loss and data inconsistencies. If we don’t allow them to become leaders, we face lower availability as we have to wait for the original leader to become available before the partition is back online.When to enable unclean leader election
| Use case | Recommendation | Reason |
|---|---|---|
| Financial transactions | Disable | Data loss unacceptable |
| Metrics/logs | Consider enabling | Availability more important |
| Event streaming | Depends on criticality | Evaluate trade-off |
| Audit compliance | Disable | Regulatory requirements |
Configure unclean leader election
Enable for a specific topic
Disable (restore default)
Verify configuration
See it in practice with ConduktorConduktor Console displays topic configurations including unclean leader election status. Monitor ISR counts and leader distribution to understand your replication health.
Next steps
- Configure min.insync.replicas for durability guarantees
- Understand topic replication fundamentals
- Set up monitoring for ISR health