Re: Logical replication keepalive flood

From: Abbas Butt <abbas(dot)butt(at)enterprisedb(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Zahid Iqbal <zahid(dot)iqbal(at)enterprisedb(dot)com>
Subject: Re: Logical replication keepalive flood
Date: 2021-06-08 12:21:56
Message-ID: CALtH27cpR9BUT97fuZ3K9HitFy6kx-iLz9o_tAG4Amf1YEsy-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kyotaro,
I have tried to test your patches. Unfortunately even after applying the
patches
the WAL Sender is still sending too frequent keepalive messages.
In my opinion the fix is to make sure that wal_sender_timeout/2 has passed
before sending
the keepalive message in the code fragment I had shared earlier.
In other words we should replace the call to
WalSndKeepalive(false);
with
WalSndKeepaliveIfNecessary(false);

Do you agree with the suggested fix?

On Tue, Jun 8, 2021 at 10:09 AM Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
wrote:

> At Tue, 08 Jun 2021 10:05:36 +0900 (JST), Kyotaro Horiguchi <
> horikyota(dot)ntt(at)gmail(dot)com> wrote in
> > At Mon, 7 Jun 2021 15:26:05 +0500, Abbas Butt <
> abbas(dot)butt(at)enterprisedb(dot)com> wrote in
> > > On Mon, Jun 7, 2021 at 3:13 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> > > > I am not sure sending feedback every time before sleep is a good
> idea,
> > > > this might lead to unnecessarily sending more messages. Can we try by
> > > > using one-second interval with -s option to see how it behaves? As a
> > > > matter of comparison the similar logic in workers.c uses
> > > > wal_receiver_timeout to send such an update message rather than
> > > > sending it every time before sleep.
> >
> > Logical walreceiver sends a feedback when walrcv_eceive() doesn't
> > receive a byte. If its' not good that pg_recvlogical does the same
> > thing, do we need to improve logical walsender's behavior as well?
>
> For the clarity, only the change in the walsender side can stop the
> flood.
>
> regards.
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
>

--
--
*Abbas*
Senior Architect

Ph: 92.334.5100153
Skype ID: gabbasb
edbpostgres.com

*Follow us on Twitter*
@EnterpriseDB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2021-06-08 12:27:14 Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Previous Message Justin Pryzby 2021-06-08 12:11:36 Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic