Re: Revised patch for fixing archiver shutdown behavior - Mailing list pgsql-patches

From Tom Lane
Subject Re: Revised patch for fixing archiver shutdown behavior
Date
Msg-id 6075.1199980168@sss.pgh.pa.us
Whole thread Raw
In response to Re: Revised patch for fixing archiver shutdown behavior  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Revised patch for fixing archiver shutdown behavior
Re: Revised patch for fixing archiver shutdown behavior
List pgsql-patches
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

pgsql-patches by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: reference problem of manifest.(win32.mak of libpq.dll)
Next
From: Simon Riggs
Date:
Subject: Re: Revised patch for fixing archiver shutdown behavior