Re: walsender waiting_for_ping spuriously set

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: walsender waiting_for_ping spuriously set
Дата
Msg-id 20200807225512.GA28635@alvherre.pgsql
обсуждение исходный текст
Ответ на walsender waiting_for_ping spuriously set  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: walsender waiting_for_ping spuriously set  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Should the nbtree page split REDO routine's locking work more like the locking on the primary?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: walsender waiting_for_ping spuriously set