From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Yann ROBIN <me.show@gmail.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Database corrupted
Date: Mon, 05 Dec 2011 14:46:00 -0600
Message-ID: <4EDCD928020000250004385E@gw.wicourts.gov> (raw)
In-Reply-To: <CAOR=d=04pU3x3mWk7dKw70Ctz5o_oBepTqEjWERwqvZJDsE8rA@mail.gmail.com>
References: <CAAhgiZ61svTSRLo0HNZ-Nw7mNXTdNyabmwCYU_eJxVRxSCT9wA@mail.gmail.com>
<4EDCCF3A0200002500043859@gw.wicourts.gov>
<CAAhgiZ6k+=YBPfJJZ=beRh5r_YxNeyrZEFW91CeRFbvrdcX22Q@mail.gmail.com>
<CAOR=d=04pU3x3mWk7dKw70Ctz5o_oBepTqEjWERwqvZJDsE8rA@mail.gmail.com>
Scott Marlowe <scott.marlowe@gmail.com> wrote:
> Yann ROBIN <me.show@gmail.com> wrote:
>> Version 9.0.4 on debian squeeze 6.0 running in KVM with virtio
>> (kernel 2.6.32)
I don't know anything about KVM or vertio, so hopefully others will
step up.
>> I think we have a hard drive issue.
If at all possible, I would try to sort that out before continuing
recovery. You could keep piling up one disk error on top of
another; and each can make the others harder to sort out and fix.
>> kill -9 of the writer process
>
> Are you sure you killed all the postgres backends before
> restarting the server? If other backends are still running, with
> a dead postmaster, and you restart the server, instant corruption.
Yeah, I would make *absolutely* sure there isn't an orphaned
postgres process still running before trying any other recovery
steps.
Once you are sure that your storage system isn't nibbling away at
your data and there isn't an old postgres process running, you might
want to list the rows with the duplicate key value, and then delete
them. The safest course, once you've rebuilt the index, is to us
pg_dump and psql (or pg_restore) to rebuild the database.
Be sure to keep that copy of the data directory tree for at *least*
a few weeks after everything seems to be running fine. You may well
belatedly discover a reason to go back and fish for some data.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, me.show@gmail.com, scott.marlowe@gmail.com
Subject: Re: Database corrupted
In-Reply-To: <4EDCD928020000250004385E@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox