postgresql/src/backend/postmaster
Tom Lane 97122b8a8e Fix postmaster's handling of a startup-process crash.
Ordinarily, a failure (unexpected exit status) of the startup subprocess
should be considered fatal, so the postmaster should just close up shop
and quit.  However, if we sent the startup process a SIGQUIT or SIGKILL
signal, the failure is hardly "unexpected", and we should attempt restart;
this is necessary for recovery from ordinary backend crashes in hot-standby
scenarios.  I attempted to implement the latter rule with a two-line patch
in commit 442231d7f7, but it now emerges that
that patch was a few bricks shy of a load: it failed to distinguish the
case of a signaled startup process from the case where the new startup
process crashes before reaching database consistency.  That resulted in
infinitely respawning a new startup process only to have it crash again.

To handle this properly, we really must track whether we have sent the
*current* startup process a kill signal.  Rather than add yet another
ad-hoc boolean to the postmaster's state, I chose to unify this with the
existing RecoveryError flag into an enum tracking the startup process's
state.  That seems more consistent with the postmaster's general state
machine design.

Back-patch to 9.0, like the previous patch.
2015-07-09 13:22:23 -04:00
..
autovacuum.c Fix thinko in comment (launcher -> worker) 2015-06-20 11:45:58 -03:00
bgwriter.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
checkpointer.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
fork_process.c Reset OpenSSL randomness state in each postmaster child process. 2013-03-27 18:50:25 -04:00
Makefile Refactor xlog.c to create src/backend/postmaster/startup.c 2011-11-02 14:25:01 +00:00
pgarch.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
pgstat.c Adjust "pgstat wait timeout" message to be a translatable LOG message. 2015-01-19 23:01:41 -05:00
postmaster.c Fix postmaster's handling of a startup-process crash. 2015-07-09 13:22:23 -04:00
startup.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
syslogger.c Fix unportable setvbuf() usage in initdb. 2014-05-15 15:58:01 -04:00
walwriter.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00