Re: Immediate shutdown and system(3) - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Immediate shutdown and system(3)
Date
Msg-id 3f0b79eb0903031806y2804e597g6d03bfb4b8ca68c2@mail.gmail.com
Whole thread Raw
In response to Re: Immediate shutdown and system(3)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Immediate shutdown and system(3)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Immediate shutdown and system(3)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Hi,

On Mon, Mar 2, 2009 at 4:59 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> Fujii Masao wrote:
>>
>> On Fri, Feb 27, 2009 at 6:52 PM, Heikki Linnakangas
>> <heikki.linnakangas@enterprisedb.com> wrote:
>>>
>>> I'm leaning towards option 3, but I wonder if anyone sees a better
>>> solution.
>>
>> 4. Use the shared memory to tell the startup process about the shutdown
>> state.
>> When a shutdown signal arrives, postmaster sets the corresponding shutdown
>> state to the shared memory before signaling to the child processes. The
>> startup
>> process check the shutdown state whenever executing system(), and
>> determine
>> how to exit according to that state. This solution doesn't change any
>> existing
>> behavior of pg_standby. What is your opinion?
>
> That would only solve the problem for pg_standby. Other programs you might
> use as a restore_command or archive_command like "cp" or "rsync" would still
> core dump on the SIGQUIT.

Right. I've just understood your intention. I also agree with option 3 if nobody
complains about lack of backward compatibility of pg_standby. If no, how about
using SIGUSR2 instead of SIGINT for immediate shutdown of only the archiver
and the startup process. SIGUSR2 by default terminates the process.
The archiver already uses SIGUSR2 for pgarch_waken_stop, so we need to
reassign that function to another signal (SIGINT is suitable, I think).
This solution doesn't need signal multiplexing. Thought?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: building pg_dump doesn't work
Next
From: Selena Deckelmann
Date:
Subject: Make SIGHUP less painful if pg_hba.conf is not readable