Hi, I confirmed that 82233ce7ea4 surely did it. At Wed, 19 Mar 2014 09:35:16 -0300, Alvaro Herrera wrote > Fujii Masao escribió: > > On Wed, Mar 19, 2014 at 7:57 PM, Heikki Linnakangas > > <hlinnakan...@vmware.com> wrote: > > > >> 9.4 canceles backup mode even on immediate shutdown so the > > >> operation causes no problem, but 9.3 and before are doesn't. > > > > > > Hmm, I don't think we've changed that behavior in 9.4. > > > > ISTM 82233ce7ea42d6ba519aaec63008aff49da6c7af changed immdiate > > shutdown that way. > > Uh, interesting. I didn't see that secondary effect. I hope it's not > for ill?
The crucial factor for the behavior change is that pmdie has become not to exit immediately for SIGQUIT. 'case SIGQUIT:' in pmdie() ended with "ExitPostmaster(0)" before the patch but now it ends with 'PostmasterStateMachine(); break;' so continues to run with pmState = PM_WAIT_BACKENDS, similar to SIGINT (fast shutdown). After all, pmState changes to PM_NO_CHILDREN via PM_WAIT_DEAD_END by SIGCHLDs from non-significant processes, then CancelBackup(). Focusing on the point described above, the small patch below rewinds the behavior back to 9.3 and before but I don't know the appropriateness in regard to the intention of the patch. diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index e9072b7..f87c25c 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -2498,16 +2498,7 @@ pmdie(SIGNAL_ARGS) (errmsg("received immediate shutdown request"))); TerminateChildren(SIGQUIT); - pmState = PM_WAIT_BACKENDS; - - /* set stopwatch for them to die */ - AbortStartTime = time(NULL); - - /* - * Now wait for backends to exit. If there are none, - * PostmasterStateMachine will take the next step. - */ - PostmasterStateMachine(); + ExitPostmaster(0); break; } regards, -- Kyotaro Horiguchi NTT Open Source Software Center -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers