*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.607 2010/05/14 18:08:33 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.608 2010/05/15 20:01:32 rhaas Exp $
*
* NOTES
*
* postmaster, and we switch to PM_RECOVERY state. The background writer is
* launched, while the startup process continues applying WAL. If Hot Standby
* is enabled, then, after reaching a consistent point in WAL redo, startup
- * process signals us again, and we switch to PM_RECOVERY_CONSISTENT state and
+ * process signals us again, and we switch to PM_HOT_STANDBY state and
* begin accepting connections to perform read-only queries. When archive
* recovery is finished, the startup process exits with exit code 0 and we
* switch to PM_RUN state.
*
* Normal child backends can only be launched when we are in PM_RUN or
- * PM_RECOVERY_CONSISTENT state. (We also allow launch of normal
+ * PM_HOT_STANDBY state. (We also allow launch of normal
* child backends in PM_WAIT_BACKUP state, but only for superusers.)
* In other states we handle connection requests by launching "dead_end"
* child processes, which will simply send the client an error message and
PM_INIT, /* postmaster starting */
PM_STARTUP, /* waiting for startup subprocess */
PM_RECOVERY, /* in archive recovery mode */
- PM_RECOVERY_CONSISTENT, /* consistent recovery mode */
+ PM_HOT_STANDBY, /* in hot standby mode */
PM_RUN, /* normal "database is alive" state */
PM_WAIT_BACKUP, /* waiting for online backup mode to end */
PM_WAIT_READONLY, /* waiting for read only backends to exit */
*/
if (BgWriterPID == 0 &&
(pmState == PM_RUN || pmState == PM_RECOVERY ||
- pmState == PM_RECOVERY_CONSISTENT))
+ pmState == PM_HOT_STANDBY))
BgWriterPID = StartBackgroundWriter();
/*
pmState == PM_RECOVERY))
return CAC_STARTUP; /* normal startup */
if (!FatalError &&
- pmState == PM_RECOVERY_CONSISTENT)
- return CAC_OK; /* connection OK during recovery */
+ pmState == PM_HOT_STANDBY)
+ return CAC_OK; /* connection OK during hot standby */
return CAC_RECOVERY; /* else must be crash recovery */
}
(errmsg("received smart shutdown request")));
if (pmState == PM_RUN || pmState == PM_RECOVERY ||
- pmState == PM_RECOVERY_CONSISTENT)
+ pmState == PM_HOT_STANDBY)
{
/* autovacuum workers are told to shut down immediately */
SignalAutovacWorkers(SIGTERM);
pmState == PM_WAIT_BACKUP ||
pmState == PM_WAIT_READONLY ||
pmState == PM_WAIT_BACKENDS ||
- pmState == PM_RECOVERY_CONSISTENT)
+ pmState == PM_HOT_STANDBY)
{
ereport(LOG,
(errmsg("aborting any active transactions")));
FatalError = true;
/* We now transit into a state of waiting for children to die */
if (pmState == PM_RECOVERY ||
- pmState == PM_RECOVERY_CONSISTENT ||
+ pmState == PM_HOT_STANDBY ||
pmState == PM_RUN ||
pmState == PM_WAIT_BACKUP ||
pmState == PM_WAIT_READONLY ||
PG_SETMASK(&BlockSig);
/*
- * RECOVERY_STARTED and RECOVERY_CONSISTENT signals are ignored in
+ * RECOVERY_STARTED and BEGIN_HOT_STANDBY signals are ignored in
* unexpected states. If the startup process quickly starts up, completes
* recovery, exits, we might process the death of the startup process
* first. We don't want to go back to recovery in that case.
pmState = PM_RECOVERY;
}
- if (CheckPostmasterSignal(PMSIGNAL_RECOVERY_CONSISTENT) &&
+ if (CheckPostmasterSignal(PMSIGNAL_BEGIN_HOT_STANDBY) &&
pmState == PM_RECOVERY)
{
/*
ereport(LOG,
(errmsg("database system is ready to accept read only connections")));
- pmState = PM_RECOVERY_CONSISTENT;
+ pmState = PM_HOT_STANDBY;
}
if (CheckPostmasterSignal(PMSIGNAL_WAKEN_ARCHIVER) &&
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/pmsignal.h,v 1.30 2010/02/26 02:01:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/pmsignal.h,v 1.31 2010/05/15 20:01:32 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
typedef enum
{
PMSIGNAL_RECOVERY_STARTED, /* recovery has started */
- PMSIGNAL_RECOVERY_CONSISTENT, /* recovery has reached consistent
- * state */
+ PMSIGNAL_BEGIN_HOT_STANDBY, /* begin Hot Standby */
PMSIGNAL_WAKEN_ARCHIVER, /* send a NOTIFY signal to xlog archiver */
PMSIGNAL_ROTATE_LOGFILE, /* send SIGUSR1 to syslogger to rotate logfile */
PMSIGNAL_START_AUTOVAC_LAUNCHER, /* start an autovacuum launcher */