summaryrefslogtreecommitdiff
path: root/src/include/storage/pmsignal.h
diff options
context:
space:
mode:
authorRobert Haas2011-04-03 23:42:00 +0000
committerRobert Haas2011-04-03 23:42:00 +0000
commit38b27792eae99f5b4db2411f5c57ef70f850df5f (patch)
tree87314c9f0634515a9b0a3f2859af9f02e1aa9d7a /src/include/storage/pmsignal.h
parentd518d6a168797c2e3b9cf03a3b5cfa335be735bb (diff)
Avoid possible hang during smart shutdown.
If a smart shutdown occurs just as a child is starting up, and the child subsequently becomes a walsender, there is a race condition: the postmaster might count the exstant backends, determine that there is one normal backend, and wait for it to die off. Had the walsender transition already occurred before the postmaster counted, it would have proceeded with the shutdown. To fix this, have each child that transforms into a walsender kick the postmaster just after doing so, so that the state machine is certain to advance. Fujii Masao
Diffstat (limited to 'src/include/storage/pmsignal.h')
-rw-r--r--src/include/storage/pmsignal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/storage/pmsignal.h b/src/include/storage/pmsignal.h
index 97bdc7bc86d..0ca8ca0cc7e 100644
--- a/src/include/storage/pmsignal.h
+++ b/src/include/storage/pmsignal.h
@@ -29,6 +29,7 @@ typedef enum
PMSIGNAL_START_AUTOVAC_LAUNCHER, /* start an autovacuum launcher */
PMSIGNAL_START_AUTOVAC_WORKER, /* start an autovacuum worker */
PMSIGNAL_START_WALRECEIVER, /* start a walreceiver */
+ PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */
NUM_PMSIGNALS /* Must be last value of enum! */
} PMSignalReason;