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

From Tom Lane
Subject Re: Allow WAL information to recover corrupted pg_controldata
Date
Msg-id 12582.1340037809@sss.pgh.pa.us
Whole thread Raw
In response to Re: Allow WAL information to recover corrupted pg_controldata  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Allow WAL information to recover corrupted pg_controldata  (Amit Kapila <amit.kapila@huawei.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Tom Lane's message of sáb jun 16 02:41:00 -0400 2012:
>> 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.

> 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.

Hm ... well, as long as we have a clear idea of a use-case, I'm not
opposed in principle to working on this area.

> (I don't remember what is it that we had
> to do to create a fake pg_control).

AFAIR you can create pg_control from scratch already with pg_resetxlog.
The hard part is coming up with values for the counters, such as the
next WAL location.  Some of them such as next OID are pretty harmless
if you don't guess right, but I'm worried that wrong next WAL could
make things worse not better.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Allow WAL information to recover corrupted pg_controldata
Next
From: Jeff Davis
Date:
Subject: Re: temporal support patch