Re: Allow WAL information to recover corrupted pg_controldata

Amit Kapila <amit.kapila@huawei.com>

From: Amit Kapila <amit.kapila@huawei.com>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
Cc: "'Alvaro Herrera'" <alvherre@commandprompt.com>, 'Cédric Villemain' <cedric@2ndquadrant.com>, "'Pg Hackers'" <pgsql-hackers@postgresql.org>, "'Robert Haas'" <robertmhaas@gmail.com>
Date: 2012-06-19T08:46:46Z
Lists: pgsql-hackers
> I'm almost inclined to suggest that we not get next-LSN from WAL, but
> by scanning all the pages in the main data store and computing the max
> observed LSN.  This is clearly not very attractive from a performance
> standpoint, but it would avoid the obvious failure mode where you lost
> some recent WAL segments along with pg_control.

If we follow this approach, what should be handling in case next-LSN is greater than
last checkpoint record location read from WAL files. Currently I can see StratUpXLOG throws
PANIC error in such situation.
I think this can happen in case of missing some recent WAL segments.

With Regards,
Amit Kapila.