Re: Allow WAL information to recover corrupted pg_controldata - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Allow WAL information to recover corrupted pg_controldata
Date
Msg-id 1340036996-sup-8884@alvh.no-ip.org
Whole thread Raw
In response to Re: Allow WAL information to recover corrupted pg_controldata  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Allow WAL information to recover corrupted pg_controldata
List pgsql-hackers
Excerpts from Tom Lane's message of sáb jun 16 02:41:00 -0400 2012:
> Amit kapila <amit.kapila@huawei.com> writes:

> >  The suggested patch improves the logic to recover corrupt control file. So that is the reason I felt it will be
relevantto do this patch. 
>
> Well, we invented pg_resetxlog with the thought that it might be useful
> for such situations, but I'm not sure offhand that we've ever seen a
> field report of corrupted pg_control files.  For instance, a quick
> search in the archives for "incorrect checksum in control file" turns up
> only cases of pilot error, such as supposing that a 32-bit database
> could be used with a 64-bit server or vice versa.  Actual hardware
> failures on the pg_control file could be expected to result in something
> like "could not read from control file: I/O error", which I find no
> evidence for at all in the archives.

Hm, what about the situation where pg_control is lost completely to a
filesystem failure?  I remember doing disaster recovery on this problem
once ... As far as I recall the pg_xlog files were in a separate
partition so they weren't lost.  Some other files in the main data
partition were lost as well.  (I don't remember what is it that we had
to do to create a fake pg_control).

Maybe, even if Amit's code does not end up in pg_resetxlog, it could be
useful as a DR tool, assuming the code does not cause endless
maintenance burden.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Skip checkpoint on promoting from streaming replication
Next
From: Tom Lane
Date:
Subject: Re: Allow WAL information to recover corrupted pg_controldata