Re: why not kill -9 postmaster

From: Shane Ambler <pgsql(at)007Marketing(dot)com>
To: Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: why not kill -9 postmaster
Date: 2006-10-20 13:26:09
Message-ID: 4538CE71.4050806@007Marketing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)007Marketing(dot)com

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2006-10-20 13:29:54 Re: why not kill -9 postmaster
Previous Message Peter Eisentraut 2006-10-20 13:22:22 Re: why not kill -9 postmaster