Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Date
Msg-id 3f0b79eb0905150656n7e342c24l14dd7da10ba2f5a3@mail.gmail.com
Whole thread Raw
In response to Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Hi,

On Fri, May 15, 2009 at 8:56 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> Fujii Masao wrote:
>>
>> On Fri, May 15, 2009 at 8:20 PM, Heikki Linnakangas
>> <heikki.linnakangas@enterprisedb.com> wrote:
>>>
>>> The probe in findNewestTimeLine() initialized to recovery target timeline
>>> +
>>> 1. It doesn't require history files for any old timelines to be present.
>>
>> What if recovery_target_timeline = 'latest'? The unexpected (not latest)
>> recovery target timeline might be chosen when some timeline history
>> files don't exist.
>>
>>> The
>>> purpose of findNewestTimeLine() is to ensure that if you e.g recover to a
>>> point in time in timeline 5, and there's already WAL files for timelines
>>> 6
>>> and 7 in the archive, we pick a unique timeline id.
>>
>> When only the history file for timeline 6 is deleted, timeline 6 would be
>> assigned as the newest one *again* at the end of archive recovery.
>> Is this safe?
>
> If you delete history file and all the WAL for timeline 6, yeah, nothing
> stops it from being reused. It will work just fine, as if it never existed.
> If you still have the history file and WAL for the old timeline 6 lying
> around somewhere else like an older offsite backup, it's easy for the
> administrator to get confused, but there isn't much we can do about that.

OK, I probably understood your point. The timeline history files whose
timeline ID is larger than that of an oldest backup must not be deleted
from the archive. On the other hand, the smaller or equal one can be
deleted. Not all history files are necessary. So, if we don't keep older
backup, we probably can delete all files in the archive before
pg_start_backup().
Is my understanding right?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Next
From: Simon Riggs
Date:
Subject: Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file