From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: ashutosh.bapat@2ndquadrant.com, Noah Misch <noah@leadboat.com>
Subject: Re: walsender waiting_for_ping spuriously set
Date: Fri, 7 Aug 2020 18:55:12 -0400
Message-ID: <20200807225512.GA28635@alvherre.pgsql> (raw)
In-Reply-To: <20200806225558.GA22401@alvherre.pgsql>
I just noticed that part of this comment I'm modifying:
> @@ -1444,17 +1444,13 @@ WalSndWaitForWal(XLogRecPtr loc)
> * We only send regular messages to the client for full decoded
> * transactions, but a synchronous replication and walsender shutdown
> * possibly are waiting for a later location. So, before sleeping, we
> - * send a ping containing the flush location. If the receiver is
> - * otherwise idle, this keepalive will trigger a reply. Processing the
> - * reply will update these MyWalSnd locations.
> + * send a ping containing the flush location. A reply from standby is
> + * not needed and would be wasteful.
was added very recently, in f246ea3b2a5e ("In caught-up logical
walsender, sleep only in WalSndWaitForWal()."). Added Noah to CC.
I think the walreceiver will only send a reply if
wal_receiver_status_interval is set to a nonzero value. I don't
understand what reason could there possibly be for setting this
parameter to zero, but it seems better to be explicit about it, as this
code is confusing enough.
I'm thinking in keeping the sentences that were added in that commit,
maybe like so:
> * We only send regular messages to the client for full decoded
> * transactions, but a synchronous replication and walsender shutdown
> * possibly are waiting for a later location. So, before sleeping, we
> + * send a ping containing the flush location. A reply from standby is
> + * not needed and would be wasteful most of the time,
> + * but if the receiver is otherwise idle and walreceiver status messages
> + * are enabled, this keepalive will trigger a reply. Processing the
> + * reply will update these MyWalSnd locations.
(Also, the comment would be updated all the way back to 9.5, even if
f246ea3b2a5e itself was not.)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, pgsql-hackers@lists.postgresql.org, noah@leadboat.com
Subject: Re: walsender waiting_for_ping spuriously set
In-Reply-To: <20200807225512.GA28635@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox