Commit 5e85315e authored by Robert Haas's avatar Robert Haas

Avoid starting walreceiver in states where it shouldn't be running.

In particular, it's bad to start walreceiver when in state
PM_WAIT_BACKENDS, because we have no provision to kill walreceiver
when in that state.

Fujii Masao
parent c5bd8fea
......@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.609 2010/05/26 12:32:41 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.610 2010/05/27 02:01:37 rhaas Exp $
*
* NOTES
*
......@@ -4217,7 +4217,9 @@ sigusr1_handler(SIGNAL_ARGS)
}
if (CheckPostmasterSignal(PMSIGNAL_START_WALRECEIVER) &&
WalReceiverPID == 0)
WalReceiverPID == 0 &&
(pmState == PM_STARTUP || pmState == PM_RECOVERY ||
pmState == PM_HOT_STANDBY || pmState == PM_WAIT_READONLY))
{
/* Startup Process wants us to start the walreceiver process. */
WalReceiverPID = StartWalReceiver();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment