You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Pavel Cermak (Jira)" <ji...@apache.org> on 2026/05/04 16:45:00 UTC

[jira] [Commented] (KAFKA-19148) Potential Unclean Leader Election in KRaft Despite unclean.leader.election.enable=false

    [ https://issues.apache.org/jira/browse/KAFKA-19148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18078250#comment-18078250 ] 

Pavel Cermak commented on KAFKA-19148:
--------------------------------------

Hi,

I’m from Operations, managing dozens of Kafka clusters for our internal clients. We can confirm that the originally reported ULE issue has been just a false positive fixed in Kafka 4.1.

However, we are still able to reproduce potential message loss (not just reordering) when producing to the cluster with {{{{--producer-property acks=1}}}} during partition reassignment, using the steps described in the README file originally attached to this issue. We can see it on Kafka versions 3.9-kraft, 3.9-zoo, 3.4, 2.3.

Is there any follow-up on this issue regarding potential message loss during reassignment?

To clarify, I understand the risks of using {{{}{{acks=1}}{}}}, for example when the leader fails unexpectedly. However, I would not expect message loss during partition reassignment as part of regular maintenance operations (such as cluster rebalancing or scaling). Of course, {{acks=all}} eliminates the problem.

> Potential Unclean Leader Election in KRaft Despite unclean.leader.election.enable=false
> ---------------------------------------------------------------------------------------
>
>                 Key: KAFKA-19148
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19148
>             Project: Kafka
>          Issue Type: Bug
>          Components: controller
>    Affects Versions: 3.9.0, 4.0.0
>            Reporter: Julian Bergner
>            Assignee: Azhar Ahmed
>            Priority: Critical
>         Attachments: Readme_Kraft.md, Readme_Zookeeper.md, docker-compose_kraft.yml, docker-compose_zookeeper.yml
>
>
> *Issue Summary:*
> We're observing unclean leader election even though {{{}unclean.leader.election.enable=false{}}}.
> *Scenario:*
> During a partition reassignment, if we promote a non-ISR broker to leader and simultaneously remove the current leader from the ISR, Kafka still elects a new leader from outside the ISR. This behavior contradicts the expected behavior when unclean leader election is explicitly disabled.
> *Details:*
>  * *Original ISR:* [1, 2]
>  * *New ISR after reassignment:* [3, 2]
> *Kafka Versions Tested:*
>  * Kafka 4.0.0 (KRaft mode)
>  * Kafka 3.9.0 (Kraft mode)
>  * Kafka 3.9.0 (Zookeeper mode)
> *Observation:*
>  * The behaviour differs between the two modes.
>  * In Kraft, unclean leader election occurred, which should not happen with the config set to {{{}false{}}}.
>  * In Zookeeper no unclean leader election occurred.
> *Attachments:*
> Docker Compose files and reproduction steps for both:
>  * Kafka 4.0.0 (KRaft)
>  * Kafka 3.9.0 (Zookeeper)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)