Re: Avoiding a needless failure of PITR - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Avoiding a needless failure of PITR
Date
Msg-id 1209050333.4259.1566.camel@ebony.site
Whole thread Raw
In response to Avoiding a needless failure of PITR  (Fujii Masao <fujii.masao@oss.ntt.co.jp>)
List pgsql-hackers
On Thu, 2008-04-24 at 23:25 +0900, Fujii Masao wrote:
> Hi,
> 
> PITR always fails in finding the archived log file with wrong size. But,
> I think that we can continue PITR if .ready file of the same name exists
> in XLOGDIR/archive_status, ie the complete file might exist in XLOGDIR.
> 
> I want to modify the implementation of PITR a little as follows.
> 
> - In PITR, if the archived log file with wrong size is found,
>   we check for .ready in XLOGDIR/archive_status.
> 
> - If .ready exists, we try to continue PITR by using the log file in XLOGDIR.
>   (The log message about the situation might be needed.)
> 
> - Otherwise, we make PITR fail as it is (making fatal error).

If you do get this error *and* you have a good copy of the file
somewhere, then you can copy it to the archive and restart recovery.

If we didn't fail, but checked for a local copy then it would have
worked automatically in your case, thats true. But it would fail in any
other case where a truncated file was copied over even though a good
copy is available, such as when 2 copies of archived files are
maintained remotely.

We should look upon the FATAL error as an opportunity to intervene and
then restart recovery, rather than a problem itself.

--  Simon Riggs 2ndQuadrant  http://www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Proposed patch - psql wraps at window width
Next
From: Peter Eisentraut
Date:
Subject: Re: Proposed patch - psql wraps at window width