3737 *
3838 *
3939 * IDENTIFICATION
40- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.607 2010/05/14 18:08:33 rhaas Exp $
40+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.608 2010/05/15 20:01:32 rhaas Exp $
4141 *
4242 * NOTES
4343 *
@@ -240,13 +240,13 @@ static bool RecoveryError = false;/* T if WAL recovery failed */
240240 * postmaster, and we switch to PM_RECOVERY state. The background writer is
241241 * launched, while the startup process continues applying WAL. If Hot Standby
242242 * is enabled, then, after reaching a consistent point in WAL redo, startup
243- * process signals us again, and we switch toPM_RECOVERY_CONSISTENT state and
243+ * process signals us again, and we switch toPM_HOT_STANDBY state and
244244 * begin accepting connections to perform read-only queries. When archive
245245 * recovery is finished, the startup process exits with exit code 0 and we
246246 * switch to PM_RUN state.
247247 *
248248 * Normal child backends can only be launched when we are in PM_RUN or
249- *PM_RECOVERY_CONSISTENT state. (We also allow launch of normal
249+ *PM_HOT_STANDBY state. (We also allow launch of normal
250250 * child backends in PM_WAIT_BACKUP state, but only for superusers.)
251251 * In other states we handle connection requests by launching "dead_end"
252252 * child processes, which will simply send the client an error message and
@@ -273,7 +273,7 @@ typedef enum
273273PM_INIT ,/* postmaster starting */
274274PM_STARTUP ,/* waiting for startup subprocess */
275275PM_RECOVERY ,/* in archive recovery mode */
276- PM_RECOVERY_CONSISTENT ,/*consistent recovery mode */
276+ PM_HOT_STANDBY ,/*in hot standby mode */
277277PM_RUN ,/* normal "database is alive" state */
278278PM_WAIT_BACKUP ,/* waiting for online backup mode to end */
279279PM_WAIT_READONLY ,/* waiting for read only backends to exit */
@@ -1450,7 +1450,7 @@ ServerLoop(void)
14501450 */
14511451if (BgWriterPID == 0 &&
14521452(pmState == PM_RUN || pmState == PM_RECOVERY ||
1453- pmState == PM_RECOVERY_CONSISTENT ))
1453+ pmState == PM_HOT_STANDBY ))
14541454BgWriterPID = StartBackgroundWriter ();
14551455
14561456/*
@@ -1927,8 +1927,8 @@ canAcceptConnections(void)
19271927pmState == PM_RECOVERY ))
19281928return CAC_STARTUP ;/* normal startup */
19291929if (!FatalError &&
1930- pmState == PM_RECOVERY_CONSISTENT )
1931- return CAC_OK ;/* connection OK duringrecovery */
1930+ pmState == PM_HOT_STANDBY )
1931+ return CAC_OK ;/* connection OK duringhot standby */
19321932return CAC_RECOVERY ;/* else must be crash recovery */
19331933}
19341934
@@ -2168,7 +2168,7 @@ pmdie(SIGNAL_ARGS)
21682168(errmsg ("received smart shutdown request" )));
21692169
21702170if (pmState == PM_RUN || pmState == PM_RECOVERY ||
2171- pmState == PM_RECOVERY_CONSISTENT )
2171+ pmState == PM_HOT_STANDBY )
21722172{
21732173/* autovacuum workers are told to shut down immediately */
21742174SignalAutovacWorkers (SIGTERM );
@@ -2226,7 +2226,7 @@ pmdie(SIGNAL_ARGS)
22262226pmState == PM_WAIT_BACKUP ||
22272227pmState == PM_WAIT_READONLY ||
22282228pmState == PM_WAIT_BACKENDS ||
2229- pmState == PM_RECOVERY_CONSISTENT )
2229+ pmState == PM_HOT_STANDBY )
22302230{
22312231ereport (LOG ,
22322232(errmsg ("aborting any active transactions" )));
@@ -2784,7 +2784,7 @@ HandleChildCrash(int pid, int exitstatus, const char *procname)
27842784FatalError = true;
27852785/* We now transit into a state of waiting for children to die */
27862786if (pmState == PM_RECOVERY ||
2787- pmState == PM_RECOVERY_CONSISTENT ||
2787+ pmState == PM_HOT_STANDBY ||
27882788pmState == PM_RUN ||
27892789pmState == PM_WAIT_BACKUP ||
27902790pmState == PM_WAIT_READONLY ||
@@ -4135,7 +4135,7 @@ sigusr1_handler(SIGNAL_ARGS)
41354135PG_SETMASK (& BlockSig );
41364136
41374137/*
4138- * RECOVERY_STARTED andRECOVERY_CONSISTENT signals are ignored in
4138+ * RECOVERY_STARTED andBEGIN_HOT_STANDBY signals are ignored in
41394139 * unexpected states. If the startup process quickly starts up, completes
41404140 * recovery, exits, we might process the death of the startup process
41414141 * first. We don't want to go back to recovery in that case.
@@ -4155,7 +4155,7 @@ sigusr1_handler(SIGNAL_ARGS)
41554155
41564156pmState = PM_RECOVERY ;
41574157}
4158- if (CheckPostmasterSignal (PMSIGNAL_RECOVERY_CONSISTENT )&&
4158+ if (CheckPostmasterSignal (PMSIGNAL_BEGIN_HOT_STANDBY )&&
41594159pmState == PM_RECOVERY )
41604160{
41614161/*
@@ -4167,7 +4167,7 @@ sigusr1_handler(SIGNAL_ARGS)
41674167ereport (LOG ,
41684168(errmsg ("database system is ready to accept read only connections" )));
41694169
4170- pmState = PM_RECOVERY_CONSISTENT ;
4170+ pmState = PM_HOT_STANDBY ;
41714171}
41724172
41734173if (CheckPostmasterSignal (PMSIGNAL_WAKEN_ARCHIVER )&&