Re: Best way to sync possibly corrupted data? - Mailing list pgsql-general

From Michael Paquier
Subject Re: Best way to sync possibly corrupted data?
Date
Msg-id CAB7nPqQT+9cg8SRWundXwH5WHyeT-8AOWf-35L0t=t4qRks4ig@mail.gmail.com
Whole thread Raw
In response to Best way to sync possibly corrupted data?  ("Anand Kumar, Karthik" <Karthik.AnandKumar@classmates.com>)
Responses Re: Best way to sync possibly corrupted data?  (Shaun Thomas <sthomas@optionshouse.com>)
List pgsql-general
On Fri, Dec 20, 2013 at 5:28 AM, Anand Kumar, Karthik
<Karthik.AnandKumar@classmates.com> wrote:
> HI,
>
> We have an issue with possibly corrupt data in our postgresql server. Errors
> like:
>
> ERROR:  index "photos_p00_n2" contains unexpected zero page at block 0
> ERROR:  invalid page header in block 12707 of relation
> pg_tblspc/5020557/PG_9.1_201105231/16393/9014673
>
> Thanks to all the suggestions from this list. We are in the process of
> moving our database out to a different server, and we'll then set
> zero_dameged_pages to on, run a full vacuum and reindex.
>
> The question I have is – what is the best method to transfer the data over
> to ensure we don't copy over bad/corrupt data? I would think a filesystem
> based copy (rsync, etc) should be avoided, and a pg_dump with a new initdb
> is best?
You should go with pg_dump if you are able to get a clean dump. Such
block errors happen because of hardware issues, so you are not safe
from additional failures that might happen while you do a copy of the
existing data folder to a new system.

Regards,
--
Michael


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Is it advisable to pg_upgrade directly from 9.0 to 9.3?
Next
From: Albe Laurenz
Date:
Subject: Re: inconsistent backup?