Skip to content

Commit 5e85315

Browse files
committed
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
1 parent c5bd8fe commit 5e85315

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.609 2010/05/26 12:32:41 rhaas Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.610 2010/05/27 02:01:37 rhaas Exp $
4141
*
4242
* NOTES
4343
*
@@ -4217,7 +4217,9 @@ sigusr1_handler(SIGNAL_ARGS)
42174217
}
42184218

42194219
if (CheckPostmasterSignal(PMSIGNAL_START_WALRECEIVER) &&
4220-
WalReceiverPID == 0)
4220+
WalReceiverPID == 0 &&
4221+
(pmState == PM_STARTUP || pmState == PM_RECOVERY ||
4222+
pmState == PM_HOT_STANDBY || pmState == PM_WAIT_READONLY))
42214223
{
42224224
/* Startup Process wants us to start the walreceiver process. */
42234225
WalReceiverPID = StartWalReceiver();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy