Re: Invalid page header

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Burrell <imb(at)rentrak(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Invalid page header
Date: 2004-07-22 18:24:07
Message-ID: 11036.1090520647@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ian Burrell <imb(at)rentrak(dot)com> writes:
> I get the following error message when doing a select on a table:
> ERROR: invalid page header in block 295 of relation "reported_titles"

> How do I fix this corruption?

You can zap just the failed block by turning on "zero_damaged_pages";
that will at least allow you to recover the rest of the table. If you
want to try harder, you could look at the damaged page with pg_filedump
(http://sources.redhat.com/rhdb/) or a similar tool and try to intuit
how to fix it manually.

> What could cause the corruption? We are using custom C code. Could
> bugs in this be causing it? Or is hardware problems more likely?

Hmm. A scribble-on-memory kind of bug could cause this, but in my
experience it's unusual for coding errors to trash the disk buffers ---
that's a relatively small part of your address space, and usually a
memory clobber will crash the backend elsewhere before it hits a disk
buffer. (BTW, one reason we force a database restart after a backend
crash is in hopes of not letting any such clobber make it to disk. The
contents of shared disk buffers are simply thrown away in a restart.)

It would probably be worth your while to look at the damaged page with
pg_filedump before you zap it. The symptoms of hardware misfeasance and
software errors are enough different that you can often tell which
theory to believe by examining the bits.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Si Chen 2004-07-22 19:16:38 how to find transaction associated with a lock
Previous Message Eduardo S. Fontanetti 2004-07-22 18:14:54 Re: Conversion de MDB a Postgres