Re: why not kill -9 postmaster - Mailing list pgsql-general

From Shane Ambler
Subject Re: why not kill -9 postmaster
Date
Msg-id 4538CE71.4050806@007Marketing.com
Whole thread Raw
In response to Re: why not kill -9 postmaster  (Andreas Seltenreich <andreas+pg@gate450.dyndns.org>)
Responses Re: why not kill -9 postmaster  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: why not kill -9 postmaster  (Ray Stell <stellr@cns.vt.edu>)
Re: why not kill -9 postmaster  ("Dawid Kuroczko" <qnex42@gmail.com>)
List pgsql-general
Andreas Seltenreich wrote:
> Ron Johnson writes:
>
>> On 10/20/06 05:27, Andreas Seltenreich wrote:
>>> ,----[ <http://www.postgresql.org/docs/8.1/static/postmaster-shutdown.html#AEN18182> ]
>>> | It is best not to use SIGKILL to shut down the server. Doing so will
>>> | prevent the server from releasing shared memory and semaphores,
>>> | which may then have to be done manually before a new server can be
>>> | started. Furthermore, SIGKILL kills the postmaster process without
>>> | letting it relay the signal to its subprocesses, so it will be
>>> | necessary to kill the individual subprocesses by hand as well.
>>> `----
>> But it can't be fatal, can it?
>
> While it could be fixed by hand, the list archives tell that it was
> fatal enough for some to shoot themselves in their feet.
>
>> After all, that's what a system crash is, right?
>
> A system crash is safer in that it won't leave orphaned child
> processes or IPC/synchronization resources around, making it more
> comparable to a SIGQUIT than a SIGKILL.
>

The one thing worse than kill -9 the postmaster is pulling the power
cord out of the server. Which is what makes UPS's so good.

If your server is changing the data file on disk and you pull the power
cord, what chance do you expect of reading that data file again?

While every attempt is made to make the server as reliable as possible
and to be able to recover as much as possible when things go wrong,
abrupt stops (whether from kill -9 or other) at the worst time will make
you dig out your backup copies or spend hours or days manually fixing
what is left to get as much data as you can.

If you are testing and developing that probably won't matter, but what
would it cost you or your company if you lost all the data in your
database? What about lost productivity during the time spent recovering?
Is it worth risking all that?

--

Shane Ambler
Postgres@007Marketing.com

Get Sheeky @ http://Sheeky.Biz

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: why not kill -9 postmaster
Next
From: Alvaro Herrera
Date:
Subject: Re: why not kill -9 postmaster