A Kafka unclean leader election is a situation where multiple brokers in a Kafka cluster claim to be the leader for the same partition. This can occur due to misconfiguration or network issues. The result is that data may be lost or duplicated, which can cause downstream issues for consumers. It is important to quickly identify and resolve this type of incident to ensure the proper functioning of the Kafka cluster.
Parameters
Debug
List all topics in the Kafka cluster
Describe a specific topic, including the number of partitions and replica assignment
Check the status of the Kafka brokers
Check the status of the ZooKeeper ensemble that is used by the Kafka cluster for coordination
Check the Kafka configuration file to ensure that the unclean.leader.election.enable
Check the Kafka logs for any errors or warning messages related to leader elections
Increase the number of replicas for partition.
Repair
Check the Kafka configuration file on each broker to ensure that the unclean.leader.election.enable property is set to false. If it is set to true, change it to false and restart the broker.
Learn more
Related Runbooks
Check out these related runbooks to help you debug and resolve similar issues.