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

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

From: Mikael Krantz <mk(at)zigamorph(dot)se>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Date: 2009-05-07 07:56:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-hackers
On Wed, May 6, 2009 at 6:26 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> How to reproduce:
>>  * restore from backup
>>  * SELECT pg_start_backup('label');
>>  * take a new backup
>>  * SELECT pg_stop_backup();
>>  * copy the relevant WAL-files
>>  * try to restore the backup
> I failed to reproduce this. Is it possible that the history file went
> missing in the process? That's needed to recover WAL files from timelines
> other than the latest one. You should only get that "unexpected timeline ID"
> message if the history file doesn't contain a line for that timeline ID.

Yes that's true. The history file is not included in the backup. It is
archived before the backup starts and is not included in the
range specified in the backup file (e.g:

Doesn't this mean that the range of log-files in the backup file is
incorrect? If the first WAL-file in the range contain records
referring to earlier timelines I will have to backup the .history-file
of that timeline in addition to the WAL-files explicitly required for
the backup. Or force a switch of log-files before starting the backup
as I'm currently doing.

The reason I stumbled onto this is that I've setup an automatic test
that sets up a warm standby, fails over, sets up a new warm server and
so on. This causes me to take new base backups very soon after a
finished recovery process.


In response to


pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2009-05-07 09:15:38
Subject: Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Previous:From: Peter EisentrautDate: 2009-05-07 07:11:09
Subject: Re: WIP patch for TODO Item: Add prompt escape to display the client and server versions

pgsql-bugs by date

Next:From: Dave PageDate: 2009-05-07 08:30:48
Subject: Re: BUG #4785: Installation fails
Previous:From: Dave PageDate: 2009-05-06 19:56:03
Subject: Re: BUG #4785: Installation fails

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