Fix postmaster's handling of a startup-process crash.
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 442231d7f71764b8c628044e7ce2225f9aa43b67, 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.

adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,xinzweb/gpdb,lisakowen/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,lisakowen/gpdb,jmcatamney/gpdb,lisakowen/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,50wu/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,adam8157/gpdb,xinzweb/gpdb,jmcatamney/gpdb,xinzweb/gpdb,adam8157/gpdb,ashwinstar/gpdb,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,adam8157/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,ashwinstar/gpdb,xinzweb/gpdb,jmcatamney/gpdb