37
37
*
38
38
*
39
39
* 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 $
41
41
*
42
42
* NOTES
43
43
*
@@ -240,13 +240,13 @@ static bool RecoveryError = false;/* T if WAL recovery failed */
240
240
* postmaster, and we switch to PM_RECOVERY state. The background writer is
241
241
* launched, while the startup process continues applying WAL. If Hot Standby
242
242
* 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
244
244
* begin accepting connections to perform read-only queries. When archive
245
245
* recovery is finished, the startup process exits with exit code 0 and we
246
246
* switch to PM_RUN state.
247
247
*
248
248
* 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
250
250
* child backends in PM_WAIT_BACKUP state, but only for superusers.)
251
251
* In other states we handle connection requests by launching "dead_end"
252
252
* child processes, which will simply send the client an error message and
@@ -273,7 +273,7 @@ typedef enum
273
273
PM_INIT ,/* postmaster starting */
274
274
PM_STARTUP ,/* waiting for startup subprocess */
275
275
PM_RECOVERY ,/* in archive recovery mode */
276
- PM_RECOVERY_CONSISTENT ,/*consistent recovery mode */
276
+ PM_HOT_STANDBY ,/*in hot standby mode */
277
277
PM_RUN ,/* normal "database is alive" state */
278
278
PM_WAIT_BACKUP ,/* waiting for online backup mode to end */
279
279
PM_WAIT_READONLY ,/* waiting for read only backends to exit */
@@ -1450,7 +1450,7 @@ ServerLoop(void)
1450
1450
*/
1451
1451
if (BgWriterPID == 0 &&
1452
1452
(pmState == PM_RUN || pmState == PM_RECOVERY ||
1453
- pmState == PM_RECOVERY_CONSISTENT ))
1453
+ pmState == PM_HOT_STANDBY ))
1454
1454
BgWriterPID = StartBackgroundWriter ();
1455
1455
1456
1456
/*
@@ -1927,8 +1927,8 @@ canAcceptConnections(void)
1927
1927
pmState == PM_RECOVERY ))
1928
1928
return CAC_STARTUP ;/* normal startup */
1929
1929
if (!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 */
1932
1932
return CAC_RECOVERY ;/* else must be crash recovery */
1933
1933
}
1934
1934
@@ -2168,7 +2168,7 @@ pmdie(SIGNAL_ARGS)
2168
2168
(errmsg ("received smart shutdown request" )));
2169
2169
2170
2170
if (pmState == PM_RUN || pmState == PM_RECOVERY ||
2171
- pmState == PM_RECOVERY_CONSISTENT )
2171
+ pmState == PM_HOT_STANDBY )
2172
2172
{
2173
2173
/* autovacuum workers are told to shut down immediately */
2174
2174
SignalAutovacWorkers (SIGTERM );
@@ -2226,7 +2226,7 @@ pmdie(SIGNAL_ARGS)
2226
2226
pmState == PM_WAIT_BACKUP ||
2227
2227
pmState == PM_WAIT_READONLY ||
2228
2228
pmState == PM_WAIT_BACKENDS ||
2229
- pmState == PM_RECOVERY_CONSISTENT )
2229
+ pmState == PM_HOT_STANDBY )
2230
2230
{
2231
2231
ereport (LOG ,
2232
2232
(errmsg ("aborting any active transactions" )));
@@ -2784,7 +2784,7 @@ HandleChildCrash(int pid, int exitstatus, const char *procname)
2784
2784
FatalError = true;
2785
2785
/* We now transit into a state of waiting for children to die */
2786
2786
if (pmState == PM_RECOVERY ||
2787
- pmState == PM_RECOVERY_CONSISTENT ||
2787
+ pmState == PM_HOT_STANDBY ||
2788
2788
pmState == PM_RUN ||
2789
2789
pmState == PM_WAIT_BACKUP ||
2790
2790
pmState == PM_WAIT_READONLY ||
@@ -4135,7 +4135,7 @@ sigusr1_handler(SIGNAL_ARGS)
4135
4135
PG_SETMASK (& BlockSig );
4136
4136
4137
4137
/*
4138
- * RECOVERY_STARTED andRECOVERY_CONSISTENT signals are ignored in
4138
+ * RECOVERY_STARTED andBEGIN_HOT_STANDBY signals are ignored in
4139
4139
* unexpected states. If the startup process quickly starts up, completes
4140
4140
* recovery, exits, we might process the death of the startup process
4141
4141
* first. We don't want to go back to recovery in that case.
@@ -4155,7 +4155,7 @@ sigusr1_handler(SIGNAL_ARGS)
4155
4155
4156
4156
pmState = PM_RECOVERY ;
4157
4157
}
4158
- if (CheckPostmasterSignal (PMSIGNAL_RECOVERY_CONSISTENT )&&
4158
+ if (CheckPostmasterSignal (PMSIGNAL_BEGIN_HOT_STANDBY )&&
4159
4159
pmState == PM_RECOVERY )
4160
4160
{
4161
4161
/*
@@ -4167,7 +4167,7 @@ sigusr1_handler(SIGNAL_ARGS)
4167
4167
ereport (LOG ,
4168
4168
(errmsg ("database system is ready to accept read only connections" )));
4169
4169
4170
- pmState = PM_RECOVERY_CONSISTENT ;
4170
+ pmState = PM_HOT_STANDBY ;
4171
4171
}
4172
4172
4173
4173
if (CheckPostmasterSignal (PMSIGNAL_WAKEN_ARCHIVER )&&