From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Avoid possible hang during smart shutdown. |
Date: | 2011-04-03 23:46:43 |
Message-ID: | E1Q6X0F-0000X4-Mu@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/38b27792eae99f5b4db2411f5c57ef70f850df5f
Modified Files
--------------
src/backend/postmaster/postmaster.c | 11 +++++++++--
src/backend/replication/walsender.c | 1 +
src/include/storage/pmsignal.h | 1 +
3 files changed, 11 insertions(+), 2 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2011-04-03 23:51:45 | pgsql: Remove mention of using "man" from the tutorial. |
Previous Message | Shigeru Hanada | 2011-04-03 01:51:04 | Re: Re: [COMMITTERS] pgsql: Support comments on FOREIGN DATA WRAPPER and SERVER objects. |