Re: backend hangs at immediate shutdown (Re: Back-branch update releases coming in a couple weeks) - Mailing list pgsql-hackers

From MauMau
Subject Re: backend hangs at immediate shutdown (Re: Back-branch update releases coming in a couple weeks)
Date
Msg-id 1F76D545136248B688ABEC45ABC19E01@maumau
Whole thread Raw
In response to Re: backend hangs at immediate shutdown (Re: Back-branch update releases coming in a couple weeks)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
From: "Alvaro Herrera" <alvherre@2ndquadrant.com>
> MauMau escribió:
>> I thought of adding some new state of pmState for some reason (that
>> might be the same as your idea).
>> But I refrained from doing that, because pmState has already many
>> states.  I was afraid adding a new pmState value for this bug fix
>> would complicate the state management (e.g. state transition in
>> PostmasterStateMachine()).  In addition, I felt PM_WAIT_BACKENDS was
>> appropriate because postmaster is actually waiting for backends to
>> terminate after sending SIGQUIT.  The state name is natural.
>
> Well, a natural state name is of no use if we're using it to indicate
> two different states, which I think is what would be happening here.
> Basically, with your patch, PM_WAIT_BACKENDS means two different things
> depending on AbortStartTime.

i PROBABLY GOT YOUR FEELING.  yOU AREN'T FEELING COMFORTABLE ABOUT USING THE 
TIME VARIABLE aBORTsTARTtIME AS A STATE VARIABLE TO CHANGE POSTMASTER'S 
BEHAVIOR, ARE YOU?

tHAT MAY BE RIGHT, BUT i'M NOT SURE WELL... BECAUSE IN pm_wait_backends, AS 
THE NAME INDICATES, POSTMASTER IS INDEED WAITING FOR THE BACKENDS TO 
TERMINATE REGARDLESS OF aBORTsTARTtIME.  aPART FROM THIS, POSTMASTER SEEMS 
TO CHANGE ITS BEHAVIOR IN THE SAME PMsTATE DEPENDING ON OTHER VARIABLES SUCH 
AS sHUTDOWN AND fATALeRROR.  i'M NOT CONFIDENT IN WHICH IS BETTER, SO i 
WON'T OBJECT IF THE REVIEWER OR COMMITTER MODIFIES THE CODE.

rEGARDS
mAUmAU




pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: A better way than tweaking NTUP_PER_BUCKET
Next
From: rui hua
Date:
Subject: [PATCH] Revive line type