You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Isuru Boyagane <is...@cse.mrt.ac.lk> on 2019/09/25 06:14:07 UTC

How Kafka client identify the new leader when leader fail over happens.

Hi,

Can anyone clarify the procedure of a client getting to know about a Kafka
leader failover and identify the new leader?

Thanks.

Re: How Kafka client identify the new leader when leader fail over happens.

Posted by Isuru Boyagane <is...@cse.mrt.ac.lk>.
Thanks you clarificaiton.

On Thu, 26 Sep 2019 at 00:07, Harper Henn <ha...@datto.com.invalid>
wrote:

> Hi,
>
> I think this is accomplished with metadata requests. A client sends this
> request (along with a list of topics it's interested in) to a broker in the
> cluster and gets back a list of leader/replica partitions. This is cached
> and refreshed, and when a client receives the "Not a Leader" error (means a
> request was sent to the wrong broker or a broker that went offline) they'll
> request the metadata again to find out who the new leaders are.
>
> My source for this is Kafka The Definitive Guide, Chapter 5, but someone
> correct me if this is wrong.
>
> Harper
>
> On Tue, Sep 24, 2019 at 11:15 PM Isuru Boyagane <
> isuruboyagane.16@cse.mrt.ac.lk> wrote:
>
> > Hi,
> >
> > Can anyone clarify the procedure of a client getting to know about a
> Kafka
> > leader failover and identify the new leader?
> >
> > Thanks.
> >
>


-- 
Best Regards

Isuru Boyagane
Undergraduate
Department of Computer Science & Engineering
University of Moratuwa

Re: How Kafka client identify the new leader when leader fail over happens.

Posted by Harper Henn <ha...@datto.com.INVALID>.
Hi,

I think this is accomplished with metadata requests. A client sends this
request (along with a list of topics it's interested in) to a broker in the
cluster and gets back a list of leader/replica partitions. This is cached
and refreshed, and when a client receives the "Not a Leader" error (means a
request was sent to the wrong broker or a broker that went offline) they'll
request the metadata again to find out who the new leaders are.

My source for this is Kafka The Definitive Guide, Chapter 5, but someone
correct me if this is wrong.

Harper

On Tue, Sep 24, 2019 at 11:15 PM Isuru Boyagane <
isuruboyagane.16@cse.mrt.ac.lk> wrote:

> Hi,
>
> Can anyone clarify the procedure of a client getting to know about a Kafka
> leader failover and identify the new leader?
>
> Thanks.
>