mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
action_at_recovery_target recovery config option
action_at_recovery_target = pause | promote | shutdown Petr Jelinek Reviewed by Muhammad Asif Naeem, Fujji Masao and Simon Riggs
This commit is contained in:
@@ -509,6 +509,7 @@ static void ShmemBackendArrayRemove(Backend *bn);
|
||||
/* Macros to check exit status of a child process */
|
||||
#define EXIT_STATUS_0(st) ((st) == 0)
|
||||
#define EXIT_STATUS_1(st) (WIFEXITED(st) && WEXITSTATUS(st) == 1)
|
||||
#define EXIT_STATUS_3(st) (WIFEXITED(st) && WEXITSTATUS(st) == 3)
|
||||
|
||||
#ifndef WIN32
|
||||
/*
|
||||
@@ -2555,6 +2556,17 @@ reaper(SIGNAL_ARGS)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (EXIT_STATUS_3(exitstatus))
|
||||
{
|
||||
ereport(LOG,
|
||||
(errmsg("shutdown at recovery target")));
|
||||
Shutdown = SmartShutdown;
|
||||
TerminateChildren(SIGTERM);
|
||||
pmState = PM_WAIT_BACKENDS;
|
||||
/* PostmasterStateMachine logic does the rest */
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unexpected exit of startup process (including FATAL exit)
|
||||
* during PM_STARTUP is treated as catastrophic. There are no
|
||||
|
||||
Reference in New Issue
Block a user