Search Postgresql Archives

Re: why not kill -9 postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx

Get Sheeky @ http://Sheeky.Biz


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux