pgsql: Fix walsender to exit promptly if client requests shutdown.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix walsender to exit promptly if client requests shutdown.
Date: 2017-06-30 16:00:28
Message-ID: E1dQyLM-0002YC-3z@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix walsender to exit promptly if client requests shutdown.

It's possible for WalSndWaitForWal to be asked to wait for WAL that doesn't
exist yet. That's fine, in fact it's the normal situation if we're caught
up; but when the client requests shutdown we should not keep waiting.
The previous coding could wait indefinitely if the source server was idle.

In passing, improve the rather weak comments in this area, and slightly
rearrange some related code for better readability.

Back-patch to 9.4 where this code was introduced.

Discussion: https://postgr.es/m/14154.1498781234@sss.pgh.pa.us

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5aa8db0148e7f59979122b34155a30885f4eb91e

Modified Files
--------------
src/backend/replication/walsender.c | 48 ++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-06-30 16:22:38 pgsql: Check for error during PQendcopy.
Previous Message Peter Eisentraut 2017-06-30 15:25:25 pgsql: Prohibit creating ICU collation with different ctype