diff options
Diffstat (limited to 'src/backend/postmaster/startup.c')
-rw-r--r-- | src/backend/postmaster/startup.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/backend/postmaster/startup.c b/src/backend/postmaster/startup.c index ed75d0958e0..ab4d1645f24 100644 --- a/src/backend/postmaster/startup.c +++ b/src/backend/postmaster/startup.c @@ -27,8 +27,9 @@ #include "storage/ipc.h" #include "storage/latch.h" #include "storage/pmsignal.h" -#include "storage/proc.h" +#include "storage/standby.h" #include "utils/guc.h" +#include "utils/timeout.h" /* @@ -185,20 +186,12 @@ StartupProcessMain(void) /* * Properly accept or ignore signals the postmaster might send us. - * - * Note: ideally we'd not enable handle_standby_sig_alarm unless actually - * doing hot standby, but we don't know that yet. Rely on it to not do - * anything if it shouldn't. */ pqsignal(SIGHUP, StartupProcSigHupHandler); /* reload config file */ pqsignal(SIGINT, SIG_IGN); /* ignore query cancel */ pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */ pqsignal(SIGQUIT, startupproc_quickdie); /* hard crash time */ - if (EnableHotStandby) - pqsignal(SIGALRM, handle_standby_sig_alarm); /* ignored unless - * InHotStandby */ - else - pqsignal(SIGALRM, SIG_IGN); + InitializeTimeouts(); /* establishes SIGALRM handler */ pqsignal(SIGPIPE, SIG_IGN); pqsignal(SIGUSR1, StartupProcSigUsr1Handler); pqsignal(SIGUSR2, StartupProcTriggerHandler); @@ -213,10 +206,19 @@ StartupProcessMain(void) pqsignal(SIGWINCH, SIG_DFL); /* + * Register timeouts needed for standby mode + */ + RegisterTimeout(STANDBY_DEADLOCK_TIMEOUT, StandbyDeadLockHandler); + RegisterTimeout(STANDBY_TIMEOUT, StandbyTimeoutHandler); + + /* * Unblock signals (they were blocked when the postmaster forked us) */ PG_SETMASK(&UnBlockSig); + /* + * Do what we came for. + */ StartupXLOG(); /* |