You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Michał Łowicki <ml...@gmail.com> on 2021/09/20 12:30:09 UTC

Reading from lagging replicas

Hey,

When Java client is reading from replica then how is handled the case when
such replica starts to lag? (struggles to replicate data from the leader).
Does consumer, coordinator or group leader have any logic to detect such
cases and try to switch over to other replica in those cases? (pointers to
code, configuration options would be awesome). Thanks in advance.

-- 
BR,
Michał Łowicki

Re: Reading from lagging replicas

Posted by Michał Łowicki <ml...@gmail.com>.
Thanks. I'm aware of ISR but looking for exact logic inside Java client how
is this handled so when follower replica, consumer is using, starts lagging
/ goes out-of-sync.

On Mon, Sep 20, 2021 at 2:52 PM Luke Chen <sh...@gmail.com> wrote:

> Hi Michał,
> I think you want to check the term in Kafka: In Sync Replicas (a.k.a ISR).
> You might want to check the "Replication" section in doc here
> <https://kafka.apache.org/documentation/#replication>.
>
> The configuration is this one: *replica.lag.time.max.ms
> <http://replica.lag.time.max.ms>*
>
> https://kafka.apache.org/documentation/#brokerconfigs_replica.lag.time.max.ms
>
> Hope that helps.
>
> Thank you.
> Luke
>
> On Mon, Sep 20, 2021 at 8:30 PM Michał Łowicki <ml...@gmail.com> wrote:
>
> > Hey,
> >
> > When Java client is reading from replica then how is handled the case
> when
> > such replica starts to lag? (struggles to replicate data from the
> leader).
> > Does consumer, coordinator or group leader have any logic to detect such
> > cases and try to switch over to other replica in those cases? (pointers
> to
> > code, configuration options would be awesome). Thanks in advance.
> >
> > --
> > BR,
> > Michał Łowicki
> >
>


-- 
BR,
Michał Łowicki

Re: Reading from lagging replicas

Posted by Luke Chen <sh...@gmail.com>.
Hi Michał,
I think you want to check the term in Kafka: In Sync Replicas (a.k.a ISR).
You might want to check the "Replication" section in doc here
<https://kafka.apache.org/documentation/#replication>.

The configuration is this one: *replica.lag.time.max.ms
<http://replica.lag.time.max.ms>*
https://kafka.apache.org/documentation/#brokerconfigs_replica.lag.time.max.ms

Hope that helps.

Thank you.
Luke

On Mon, Sep 20, 2021 at 8:30 PM Michał Łowicki <ml...@gmail.com> wrote:

> Hey,
>
> When Java client is reading from replica then how is handled the case when
> such replica starts to lag? (struggles to replicate data from the leader).
> Does consumer, coordinator or group leader have any logic to detect such
> cases and try to switch over to other replica in those cases? (pointers to
> code, configuration options would be awesome). Thanks in advance.
>
> --
> BR,
> Michał Łowicki
>