Re: Primary keepalive message not appearing in Logical Streaming Replication

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Michael Loftis <mloftis(at)wgops(dot)com>
Cc: Virendra Negi <viren(dot)negi(at)teliax(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Primary keepalive message not appearing in Logical Streaming Replication
Date: 2019-09-15 16:01:29
Message-ID: 20190915160129.otx5xajz7652ak73@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 15, 2019 at 09:44:14AM -0600, Michael Loftis wrote:
>On Sun, Sep 15, 2019 at 08:36 Virendra Negi <viren(dot)negi(at)teliax(dot)com> wrote:
>
>> Oh I miss the documentation link there you go
>> https://www.postgresql.org/docs/9.5/protocol-replication.html
>>
>> On Sun, Sep 15, 2019 at 8:05 PM Virendra Negi <viren(dot)negi(at)teliax(dot)com>
>> wrote:
>>
>>> Agreed but why is there a message specification for it describe in the
>>> documentation and it ask to client reply back if a particular *bit* is
>>> set.(1 means that the client should reply to this message as soon as
>>> possible, to avoid a timeout disconnect. 0 otherwise)
>>>
>>
>This is unrelated to TCP keepalive. I honestly don't know where the knob is
>to turn these on but the configuration variables you quoted earlier I am
>familiar with and they are not it. Perhaps someone else can chime in with
>how to enable the protocol level keepalive in replication.
>

Pretty sure it's wal_sender_timeout. Which by default is 60s, but if you
tune it down it should send keepalives more often.

See WalSndKeepaliveIfNecessary in [1]:

[1] https://github.com/postgres/postgres/blob/master/src/backend/replication/walsender.c#L3425

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2019-09-15 16:12:03 Re: Efficient output for integer types
Previous Message Michael Loftis 2019-09-15 15:44:14 Re: Primary keepalive message not appearing in Logical Streaming Replication