diff options
author | Andres Freund <andres@anarazel.de> | 2017-06-05 18:53:41 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2017-06-05 19:18:16 -0700 |
commit | b8bd32a51f2dd451644175af7ae32f9bec3153f1 (patch) | |
tree | 1346608039cf1ede49233f4fd1bb18e8c5b92294 /src/include | |
parent | 862204aaceb1199afeda96af9579e7cb553fe00b (diff) | |
download | postgresql-b8bd32a51f2dd451644175af7ae32f9bec3153f1.tar.gz postgresql-b8bd32a51f2dd451644175af7ae32f9bec3153f1.zip |
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
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/miscadmin.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 78545daecec..196f3d172bc 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -23,6 +23,8 @@ #ifndef MISCADMIN_H #define MISCADMIN_H +#include <signal.h> + #include "pgtime.h" /* for pg_time_t */ @@ -81,6 +83,7 @@ extern PGDLLIMPORT volatile bool InterruptPending; extern PGDLLIMPORT volatile bool QueryCancelPending; extern PGDLLIMPORT volatile bool ProcDiePending; extern PGDLLIMPORT volatile bool IdleInTransactionSessionTimeoutPending; +extern PGDLLIMPORT volatile sig_atomic_t ConfigReloadPending; extern volatile bool ClientConnectionLost; @@ -272,6 +275,8 @@ extern void restore_stack_base(pg_stack_base_t base); extern void check_stack_depth(void); extern bool stack_is_too_deep(void); +extern void PostgresSigHupHandler(SIGNAL_ARGS); + /* in tcop/utility.c */ extern void PreventCommandIfReadOnly(const char *cmdname); extern void PreventCommandIfParallelMode(const char *cmdname); |