Re: 9.1.2 Postgres corruption, any way to recover? - Mailing list pgsql-performance

From Tomas Vondra
Subject Re: 9.1.2 Postgres corruption, any way to recover?
Date
Msg-id 530A6EE3.9000508@fuzzy.cz
Whole thread Raw
In response to 9.1.2 Postgres corruption, any way to recover?  (Tory M Blue <tmblue@gmail.com>)
List pgsql-performance
On 23.2.2014 21:42, Tory M Blue wrote:
> Appears one of my bigger, but older DB's cored or other this morning and
> when it came back up the DB shows that it can't start and is possibly
> corrupted. I've read this was actually due to a kernel bug sometime back
> (or at least tied to the kernel bug).
...
>
> Not holding out hope, but maybe just maybe someone has some
> ideas/shortcuts to maybe get this DB back up


I think the first thing you should ask yourself is why you're running
9.1.2, i.e. a 3 years old revision, instead of the current 9.1.12. Maybe
it's not the cause of the bug, but still ...

Also, it seems to me that the corruption happened some time ago and you
only discovered it now. Which is strange, because corrupted page header
should kill every backup attempt. Are you sure you really have backups?
I mean, tested and working backups?

Do you have an idea how many blocks are actually corrupted? Is it just
this single one, or are there more? Are you sure it's a actually due to
a kernel bug, and not a storage failure (for example)? And what kernel
do you have in mind?

There are certainly tricks to make it work (e.g. zeroing the block with
corrupted header), but that means data loss (you won't have data from
the block) and it's tedious / time consuming. If you have a working
backup, and if it's acceptable to loose the data since then, you should
probably do that.

The only thing that might help you to recover all the data is probably
PITR, i.e. a base backup + WAL archive (or replication).

regards
Tomas


pgsql-performance by date:

Previous
From: Tory M Blue
Date:
Subject: 9.1.2 Postgres corruption, any way to recover?
Next
From: Claudio Freire
Date:
Subject: Re: Bloated tables and why is vacuum full the only option