Re: Odd corruption issue reported on dba.stackexchange.com, need advice

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Marcin Mańk <marcin(dot)mank(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Odd corruption issue reported on dba.stackexchange.com, need advice
Date: 2012-07-24 13:48:36
Message-ID: 500EA7B4.3000608@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/24/2012 05:31 PM, Marcin Mańk wrote:
> On Tue, Jul 24, 2012 at 3:16 AM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au
> <mailto:ringerc(at)ringerc(dot)id(dot)au>> wrote:
>
> It shouldn't matter - only PostgreSQL was restarted, not the
> whole machine - and cleanly at that. Very strange.
>
> # if that still not helps, use the big hammer
> if (-f $info{'pgdata'}.'/postmaster.pid') {
> print "(does not shutdown, killing the process)";
> $pid = get_running_pid $info{'pgdata'}.'/postmaster.pid';
> kill (9, $pid) if $pid;
> unlink $info{'pgdata'}.'/postmaster.pid';
> $result = 0;
> }
>
> Could the "big hammer mode" be what's killed the database?

Gah, that's not very wise. While the DB is probably busy doing an
immediate shutdown with I/O in flight and backends chatting, let's just
KILL IT with no chance of recovery!

I don't know whether PostgreSQL is supposed to cope in this situation or
if it counts as abuse beyond what's reasonable. Either way it this is
the cause then either Pg or the shutdown script have a potential data
corruption bug.

Tom?

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2012-07-24 13:50:46 9.1.4: pg_restore: couldn't uncompress data?
Previous Message Dmitriy Igrishin 2012-07-24 13:48:04 Re: Roles with empty password (probably bug in libpq and in psql as well).