Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Mikael Krantz <mk(at)zigamorph(dot)se>, pgsql-bugs(at)postgresql(dot)org, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Date: 2009-05-15 14:19:04
Message-ID: 4A0D79D8.6020800@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Simon Riggs wrote:
> On Fri, 2009-05-15 at 22:56 +0900, Fujii Masao wrote:
> 
>> 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?
> 
> Heikki is right in one sense: if you do pg_start_backup() then for
> *that* backup you do not need earlier files. 
> 
> However, as you have pointed out, if you have *multiple* backups then
> deleting history files may cause problems with an earlier backup.

Yes, just as deleting old WAL files.

> It's standard practice to have >1 backup, so there is potential for
> error and minimum is we must document that. 
> 
> Rather than explaining the problem and the rules by which we can work
> out exactly which history files to keep, I think it is safer to say that
> we must keep all history files.

The rule for determining which history files need to be retained is the 
same as for WAL files. Anything archived before pg_start_backup() was 
called for the oldest backup you still want to be able to restore can be 
deleted. And the alphabetical sorting property works with history files 
as well, you can call pg_xlogfile_name(pg_start_backup()) and delete 
anything < the return value from the archive.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2009-05-15 14:32:52
Subject: Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Previous:From: Andrew DunstanDate: 2009-05-15 14:17:36
Subject: Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file

pgsql-bugs by date

Next:From: Tom LaneDate: 2009-05-15 14:23:39
Subject: Re: Perl 5.10 vs. PG 8.4 on Win32
Previous:From: Andrew DunstanDate: 2009-05-15 14:17:36
Subject: Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group