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.