pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: In caught-up logical walsender, sleep only in WalSndWaitForWal()
Date: Sat, 25 Apr 2020 17:27:56 +0000
Message-ID: <E1jSOaq-0000rX-HQ@gemulon.postgresql.org> (raw)

In caught-up logical walsender, sleep only in WalSndWaitForWal().

Before sleeping, WalSndWaitForWal() sends a keepalive if MyWalSnd->write
< sentPtr.  When the latest physical LSN yields no logical replication
messages (a common case), that keepalive elicits a reply.  Processing
the reply updates pg_stat_replication.replay_lsn.  WalSndLoop() lacks
that; when WalSndLoop() slept, replay_lsn advancement could stall until
wal_receiver_status_interval elapsed.  This sometimes stalled
src/test/subscription/t/001_rep_changes.pl for up to 10s.

Reviewed by Fujii Masao and Michael Paquier.

Discussion: https://postgr.es/m/20200418070142.GA1075445@rfd.leadboat.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f246ea3b2a5e0b75e44f0f18157c4b5e10b5547f

Modified Files
--------------
src/backend/replication/walsender.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)



Message-ID: <E1jSOaq-0000rX-HQ@gemulon.postgresql.org>
Permalink:  ../E1jSOaq-0000rX-HQ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jSOaq-0000rX-HQ@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: In caught-up logical walsender, sleep only in WalSndWaitForWal()
  In-Reply-To: <E1jSOaq-0000rX-HQ@gemulon.postgresql.org>
  References: <E1jSOaq-0000rX-HQ@gemulon.postgresql.org>

* 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