pgsql: Unify SIGHUP handling between normal and walsender backends.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Unify SIGHUP handling between normal and walsender backends.
Date: 2017-06-06 02:25:26
Message-ID: E1dI4BS-0004ug-Ly@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Unify SIGHUP handling between normal and walsender backends.

Because walsender and normal backends share the same main loop it's
problematic to have two different flag variables, set in signal
handlers, indicating a pending configuration reload. Only certain
walsender commands reach code paths checking for the
variable (START_[LOGICAL_]REPLICATION, CREATE_REPLICATION_SLOT
... LOGICAL, notably not base backups).

This is a bug present since the introduction of walsender, but has
gotten worse in releases since then which allow walsender to do more.

A later patch, not slated for v10, will similarly unify SIGHUP
handling in other types of processes as well.

Author: Petr Jelinek, Andres Freund
Reviewed-By: Michael Paquier
Discussion: https://postgr.es/m/20170423235941.qosiuoyqprq4nu7v@alap3.anarazel.de
Backpatch: 9.2-, bug is present since 9.0

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/45d067d50d8ed89ef014b2a9e625e9b1f6734587

Modified Files
--------------
src/backend/replication/walsender.c | 20 +++-----------------
src/backend/tcop/postgres.c | 30 ++++++++++++++----------------
src/backend/utils/init/globals.c | 1 +
src/include/miscadmin.h | 5 +++++
4 files changed, 23 insertions(+), 33 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-06-06 02:25:28 pgsql: Unify SIGHUP handling between normal and walsender backends.
Previous Message Andres Freund 2017-06-06 02:25:25 pgsql: Prevent possibility of panics during shutdown checkpoint.