Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> Maybe we should go back to the plan of having the postmaster
>> wait for the archiver to exit.
> Yeah, that seems the safest to me -- the problem is that it complicates
> the shutdown sequence a fair bit, because postmaster must act
> differently depending on whether archiving is enabled or not: wait for
> bgwriter exit if disabled, or for archiver exit otherwise.
Given the recent changes to make the postmaster act as a state machine,
I don't think this is really a big deal --- it's just one more state.
The bigger part is that the archiver can't wait for postmaster exit.
We'll need a proper shutdown signal for the archiver, but since it's
not using SIGUSR2 that can be commandeered easily. So it'd be like
SIGUSR1 -> do an archive cycle
SIGUSR2 -> do an archive cycle and exit
no postmaster -> just exit
The rationale for the last is that it's a crash situation, and
furthermore there's a risk of someone starting a new postmaster
and a conflicting archiver. So we should put back the behavior
my last patch removed of aborting archiving immediately on
postmaster death.
I'll respin my patch this way...
regards, tom lane