Unify SIGHUP handling between normal and walsender backends.
authorAndres Freund
Tue, 6 Jun 2017 01:53:42 +0000 (18:53 -0700)
committerAndres Freund
Tue, 6 Jun 2017 02:18:16 +0000 (19:18 -0700)
commit641a60b026c2428f7511dc3eb28e22d1b5e64a97
tree472fc9a7058468601f7d85a7f625fef938cb828b
parent50581f2e74fa1835e9981e064c8b15691c36cdd7
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[email protected]
Backpatch: 9.2-, bug is present since 9.0
src/backend/replication/walsender.c
src/backend/tcop/postgres.c
src/backend/utils/init/globals.c
src/include/miscadmin.h