[ https://issues.apache.org/jira/browse/KAFKA-19148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18008838#comment-18008838 ]
Justin Chen edited comment on KAFKA-19148 at 7/21/25 11:05 PM: --------------------------------------------------------------- [~calvinliu] Yes, we are able to reproduce data loss, following similar steps as the `Readme_Kraft.md` attached to this JIRA issue. We create a single partition topic with replication factor = 2, execute a partition reassignment that removes the leader for a non-ISR replica (triggering unclean election), and then consume the topic to observe inconsistencies (gap in incrementally increasing payload). Recorded my reproduction steps and logs here: https://gist.github.com/justin-chen/8be79292c6a0721e7d77ec8f79b6d3c1 was (Author: JIRAUSER305053): [~calvinliu] Yes, we are able to reproduce data loss, following similar steps as the `Readme_Kraft.md` attached to this JIRA issue. We create a single partition topic with replication factor = 2, execute a partition reassignment that removes the leader for a non-ISR replica, and then consume the topic to observe inconsistencies (gap in incrementally increasing payload). Recorded my reproduction steps and logs here: https://gist.github.com/justin-chen/8be79292c6a0721e7d77ec8f79b6d3c1 > 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)