Re: Allow WAL information to recover corrupted pg_controldata

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Alvaro Herrera'" <alvherre(at)commandprompt(dot)com>, 'Cédric Villemain' <cedric(at)2ndquadrant(dot)com>, "'Pg Hackers'" <pgsql-hackers(at)postgresql(dot)org>, "'Robert Haas'" <robertmhaas(at)gmail(dot)com>
Subject: Re: Allow WAL information to recover corrupted pg_controldata
Date: 2012-06-22 09:25:23
Message-ID: 003301cd5058$f44a5a30$dcdf0e90$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Based on the discussion and suggestions in this mail chain, following features can be implemented:

1. To compute the value of max LSN in data pages based on user input whether he wants it for an individual file,
a particular directory or whole database.

2a. To search the available WAL files for the latest checkpoint record and prints the value.
2b. To search the available WAL files for the latest checkpoint record and recreates a pg_control file pointing at that checkpoint.

I have kept both options to address different kind of corruption scenarios.

1. WAL files are in separate partition which is not corrupt, only the partition where data files and pg_control is corrupt. In this case users can use options 2a or 2b to proceed.
2. All pg_control, data, WAL are on same disk partition which got corrupt.
In this case he can use options 1 and 2a to decide the next-LSN for pg_control and proceed.

Suggestions?

If there is an agreement to do this features, I can send the proposal which kind of options we can keep in existing or new utility for the usage.

With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-06-22 09:42:10 Re: Catalog/Metadata consistency during changeset extraction from wal
Previous Message Andres Freund 2012-06-22 09:19:12 Re: [PATCH 04/16] Add embedded list interface (header only)