Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 40C2E1337B43 for ; Sat, 19 Feb 2011 10:53:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 48105-08 for ; Sat, 19 Feb 2011 14:53:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 711EB1336FA7 for ; Sat, 19 Feb 2011 10:53:34 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Sat, 19 Feb 2011 08:53:34 -0600 Message-Id: <4D5F8509020000250003AD64@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Sat, 19 Feb 2011 08:53:27 -0600 From: "Kevin Grittner" To: , Subject: Re: Corrupted disk Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/176 X-Sequence-Number: 36815 Tony Nelson wrote: > This morning my server (ubuntu 10.04 LTS, pg 8.4 from apt) > experienced a disk corruption which caused errors like this: > > Feb 18 08:50:07 ihdb1 postgres[13317]: [2-1] > user=postgres,db=instihire ERROR: invalid page header in block 10 > of relation base/16384/8082305 Do you know why? If not, that machine is not to be trusted. > I am ok, because I have a dump from last night, and wal since then. That dump was taken according to PITR instructions, not from pg_dump or pg_dumpall, I hope. > As a test, I tried doing a dump like this from the broken server: > > pg_dump -Fc mydb > busted.dump > > I restored this dump on a test server, and all of the data looks > ok, and my application is able to run the operation that was > failing in production just fine. > > My question is simple, is my dump good? Maybe; maybe not. I would try to restore from that dump you mentioned, run pg_dump on that, and compare the two files which came out of pg_dump. Or just use the dump if you can restore it and you're sure it's up to date. > Is it possible that pg_dump was able to correctly save the data > that "select .. " and "update.. " couldn't. pg_dump essentially just does a SELECT from each table. If the corrupted relation was an index, you might have dodged the problem mentioned above, but if a page in that index got corrupted, why assume damage was localized to that one place? You really have two problems to address here: how best to recover your data, and how to prevent a recurrence. What version of PostgreSQL is this exactly? (It's best to SELECT version(); and copy/paste the results.) -Kevin