Re: Logical replication keepalive flood - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Logical replication keepalive flood
Date
Msg-id 76b8b527-34f5-5061-e921-352bd5a2c298@gmail.com
Whole thread Raw
In response to Re: Logical replication keepalive flood  (Abbas Butt <abbas.butt@enterprisedb.com>)
Responses Re: Logical replication keepalive flood
List pgsql-hackers
Hi.

On 2021/06/08 21:21, Abbas Butt wrote:
> 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.

Sorry for the bogus patch.  I must have seen something impossible.

The keep-alive packet is immediately flushed explicitly, so Amit is 
right that no additional

pq_flush_if_writable() is not needed.

> 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?

I'm afraid not. The same is done just after unconditionally.

The issue - if actually it is - we send a keep-alive packet before a 
quite short sleep.

We really want to send it if the sleep gets long but we cannot predict 
that before entering a sleep.

Let me think a little more on this..

regards.





pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Adjust pg_regress output for new long test names
Next
From: Masahiko Sawada
Date:
Subject: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic