Re: 9.1.2 Postgres corruption, any way to recover?

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: 9.1.2 Postgres corruption, any way to recover?
Date: 2014-02-23 21:57:55
Message-ID: 530A6EE3.9000508@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Claudio Freire 2014-02-24 21:43:43 Re: Bloated tables and why is vacuum full the only option
Previous Message Tory M Blue 2014-02-23 20:42:43 9.1.2 Postgres corruption, any way to recover?