From: | Amit kapila <amit(dot)kapila(at)huawei(dot)com> |
---|---|
To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Doc Patch and test for Patch to compute Max LSN of Data Pages |
Date: | 2012-08-29 11:39:55 |
Message-ID: | 6C0B27F7206C9E4CA54AE035729E9C382852F497@szxeml509-mbs |
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.
>> I think I can see all of those things being potentially useful. There
>> are a couple of pending patches that will revise the WAL format
>> slightly; not sure how much those are likely to interfere with any
>> development you might do on (2) in the meantime.
> Based on above conclusion, I have prepared a patch which implements Option-1
This mail contains doc patch Option-1 and test cases.
Below are test scenarios corresponding to which testcases are in Test_find_max_lsn_from_datafiles
Scenario-1:
Validation of the maximum LSN number & in data base directory
Steps:
1. Start the server, create table, insert some records into the table.
2. Shutdown the server in normal mode.
3. ./pg_resetxlog -P data to find the maximum LSN number and validate with the current pg_xlog directory and in pg_control file
Expected behavior:
Displayed maximum LSN number should to same as in pg_control file &
WAL segment number displayed (fileid, segnum) should be same current file in pg_xlog directory.
Scenario-2:
Validation of the maximum LSN number & in specific directory
Steps:
1. Start the server, create table, insert some records into the table.
2. Shutdown the server in normal mode.
3. ./pg_resetxlog -p base/1/12557/ data
Expected behavior:
Displayed maximum LSN number should to same as in pg_control file &
WAL segment number displayed (fileid, segnum) should be same current file in pg_xlog directory.
Scenario-3:
Validation of the maximum LSN number & in specific file
Steps:
1. Start the server, create table, insert some records into the table.
2. Shutdown the server in normal mode.
3. ./pg_resetxlog -p base/1/12557/16384 data
Expected behavior:
Displayed maximum LSN number should to same as in pg_control file &
WAL segment number displayed (fileid, segnum) should be same current file in pg_xlog directory.
With Regards,
Amit Kapila.
Attachment | Content-Type | Size |
---|---|---|
documentation_for_pg_resetxlog_find_max_lsn_from_datafiles.patch | text/plain | 2.5 KB |
Test_find_max_lsn_from_datafiles.txt | text/plain | 1.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Gavin Flower | 2012-08-29 11:40:09 | Re: MySQL search query is not executing in Postgres DB |
Previous Message | Robert Haas | 2012-08-29 11:34:35 | Re: MySQL search query is not executing in Postgres DB |