Re: ERROR invalid page header in block xxx of relation base/xxxxx/xxxxx/

From: Jorge Torralba <jorge(dot)torralba(at)gmail(dot)com>
To: sreekanth Palluru <sree4pg(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: ERROR invalid page header in block xxx of relation base/xxxxx/xxxxx/
Date: 2016-12-07 22:50:30
Message-ID: CACut7uREpJx=pmh_VjdnTs3qFKFXxYgy5tjagj939aTj=AkJHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Look into this setting.

zero_damaged_pages = on;

The docs should explain it.

On Wed, Dec 7, 2016 at 2:47 PM, sreekanth Palluru <sree4pg(at)gmail(dot)com> wrote:

> Hi ,
>
> I am getting invalid page header error and what I could observe is when I
> select the table I get this error , where as if I select table and order by
> primary key I can retrieve the rows from table.
>
> And I don't see any dataloss ( based on total number records) after fixing
> the blocks using zero_damaged_pages=on and then vacuum full on the table
>
>
> Please note I have renamed few tables to avoid giving actual table names
>
> We run Postgres 9.2 version on Windows and Dell Optiplex XE2 server and we
> suspect that block corruption would have happen due to
> hardware/memory/power failures reasons and I have gone through wikik
> https://wiki.postgresql.org/wiki/Reliable_Writes.
>
> I want to understand why we can read the table through where there exists
> index and explain plan shows Index scan and with high cost compare to seq
> scan .
> I assume that since there no rows/data present in these corrupted blocks
> index scan skips these blocks and hence it is not throwing the error .
>
> Also , I want to know what would have caused the postgres to create these
> corrupted blocks and
> can I reproduce this error ? appreciate if you share any pointers to
> blogs/mailing lists if this type of issue is already discussed ?
>
>
> create table a.parametertable_bak as select * from a.parametertable order
> by id;
>
> labs=# select count(*) from a.parametertable_bak ;
> count
> -------
> 31415
> (1 row)
>
>
> labs=#
> labs=# checkpoint;
> CHECKPOINT
> labs=# set zero_damaged_pages=on;
> SET
> labs=# vacuum full a.parametertable;
> WARNING: invalid page header in block 204 of relation base/16413/16900;
> zeroing out page
> WARNING: invalid page header in block 205 of relation base/16413/16900;
> zeroing out page
> VACUUM
> labs=# select count(*) from a.parametertable ;
> count
> -------
> 31415
> (1 row)
>
>
> labs=#
> -Sreekanth
>

--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sreekanth Palluru 2016-12-08 01:55:39 Fwd: ERROR invalid page header in block xxx of relation base/xxxxx/xxxxx/
Previous Message sreekanth Palluru 2016-12-07 22:47:39 ERROR invalid page header in block xxx of relation base/xxxxx/xxxxx/

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-12-07 23:07:02 Re: warning about oom_adj with PG 9.4 logger
Previous Message sreekanth Palluru 2016-12-07 22:47:39 ERROR invalid page header in block xxx of relation base/xxxxx/xxxxx/