Re: why not kill -9 postmaster

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Shane Ambler <pgsql(at)007Marketing(dot)com>
Cc: Dawid Kuroczko <qnex42(at)gmail(dot)com>, Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: why not kill -9 postmaster
Date: 2006-10-20 15:12:46
Message-ID: 20061020151246.GE6718@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Shane Ambler wrote:
> Dawid Kuroczko wrote:
> >On 10/20/06, Shane Ambler <pgsql(at)007marketing(dot)com> wrote:
>
> >>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.
> >
> >
> >Well, I think that pulling the power cord is much safer than killing -9
> >the postmaster. If you pull the plug, then during bootup postgresql
> >will just replay every COMMITed transaction, so there won't be any
> >dataloss or downtime.
>
> If you kill -9 the postmaster the system can still finish sending
> changes to disk and close the file but pulling the power cord can stop a
> write in the middle of a block giving you half new data and half old
> data in the one file.

That case is protected against in the WAL code. That's what we save
whole page images for.

The only difference between kill -9 postmaster and abrupt shutdown, is
that on the former case there may be backends that continue to run and
commit transactions. Those will still be WAL-logged though.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-10-20 15:19:29 Re: why not kill -9 postmaster
Previous Message John Sidney-Woollett 2006-10-20 15:09:31 Upgrade 7.4 to 8.1 or 8.2?