Hi,

If you stop the service prior to stopping the server, it's considered as a
graceful shutdown and leader migration happens in advance. This behaviour
is controlled by controlled.shutdown.enable setting, which is true by
default. You can read more about it here:
https://kafka.apache.org/documentation/#basic_ops_restarting

But when you just stop the server, without stopping the service first,
leader failure should first be spotted (depending if you are using
Zookeeper or KRaft this process is different) and election will be
triggered afterwards, which generally takes more time comparing to a
graceful shutdown.

On Thu, Nov 23, 2023 at 12:40 PM Denis Santangelo <
denis.santang...@scorechain.com> wrote:

> Hello Denis,
>
> I'm encountering a peculiar issue with my Kafka cluster.
>
> I've been running 8 brokers on version 3.4.0 for several months, and
> everything seems to be functioning well.
>
> All my topics have at least two replicas for each partition.
>
> However, I face a problem when I shut down a server running Kafka.
>
> In such cases, my producers are unable to use the cluster, receiving the
> error: "There is no leader for this topic-partition as we are in the middle
> of a leadership election."
>
> Interestingly, if I stop the Kafka service first and then shut down the
> server, the failover works seamlessly.
>
> Could anyone provide insights into what might be going wrong, or if this is
> an issue inherent to Kafka?
>
> Thank you,
>
> Denis Santangelo
>

Reply via email to