You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jainil Rana (Jira)" <ji...@apache.org> on 2025/09/10 16:29:00 UTC

[jira] [Commented] (KAFKA-19508) Producer keeps reporting a NotLeaderOrFollowerException

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

Jainil Rana commented on KAFKA-19508:
-------------------------------------

Hi [~lazymooner] , I set up a 3-node KRaft cluster on WSL and tested leader failover. When I kill the leader broker, Raft elects a new leader and ISR updates correctly. The producer pauses briefly but does *not* show any {{{}NotLeaderOrFollowerException{}}},  messages eventually succeed without error output.
Is this the expected behavior (i.e. client-side retries fully masking the transient error), or should the producer normally expose a {{NotLeaderOrFollowerException}} during leader transitions?

> Producer keeps reporting a NotLeaderOrFollowerException
> -------------------------------------------------------
>
>                 Key: KAFKA-19508
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19508
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, core, producer 
>    Affects Versions: 3.5.0
>            Reporter: mooner
>            Assignee: Jainil Rana
>            Priority: Blocker
>         Attachments: image-2025-07-15-15-55-01-596.png, image-2025-07-15-15-59-02-855.png, image-2025-07-15-16-01-59-877.png, image-2025-07-15-16-03-13-043.png
>
>
> 1.After the server restarts, the producer keeps reporting a NotLeaderOrFollowerException when producing messages.
> !image-2025-07-15-15-55-01-596.png!
> 2.Check the zknode data; the leader is functioning normally.
> !image-2025-07-15-15-59-02-855.png!
> 3.Strangely, at 04:34:01, the leader was 12, and at 04:34:16, the leader was 11, but the leaderEpoch did not change.
> !image-2025-07-15-16-03-13-043.png!
> !image-2025-07-15-16-01-59-877.png!
> 4.state-change logs
>  



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