recover corrupted pg_controldata from WAL

From: yuanjia lee <yuanjia_pg(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: recover corrupted pg_controldata from WAL
Date: 2005-07-21 11:08:46
Message-ID: 20050721110847.42233.qmail@web34003.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi, All

I am preparing to enhance the pg_resetlog to support recover corrupted pg_control data from WAL. I had finised the code now and testing it, but before I bring it out for patch review, I want to discuss some issues here to get some advice.

The functionality of reset the xlog is the same as before, except for extracting the exactly information from WAL. I also had added a new option to recovery the pg_control file only but not to touch the xlog files. My question is that should we separate the funtionality of recovery the pg_control file and reset log? I am questioning about should we make a new name instead of pg_resetlog, we can use the name like pg_xlog and put the funtionalities (like reset log, recovery pg_control file, dump binary log) into the same tool.

The algorithm of searching the WAL is like this:

1. Read name of the segment files from xlog directory, and put all of their name into an one way list, the list is descending according to the time line, xlog id, segement id. (Athough I use only the lastest file in the implementation, but the list can be used for the feature like dump log in future.)

2. Scan the records from the beginning of the latest segement file, if checkpoint is found then update the lastcheckpoint information.

One concern for just using the last segement file is that, in some situation, the last checkpoint record may not in the last segement file but in the prevoius segement file of last segement file, this is the limitation. Although I can search from the prevoius segement file of last segement file, but the implementation now just using the last segement file.

Regards

Yuanjia Lee


---------------------------------
Start your day with Yahoo! - make it your home page

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-07-21 11:10:35 Re: No user being created during initdb for OS X
Previous Message Dave Cramer 2005-07-21 11:07:57 Re: [HACKERS] No user being created during initdb for OS X