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

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Дата
Msg-id 4A02A6BA.1030306@enterprisedb.com
обсуждение исходный текст
Ответ на Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file  (Mikael Krantz <mk@zigamorph.se>)
Ответы Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Список pgsql-bugs
Mikael Krantz wrote:
> On Wed, May 6, 2009 at 6:26 PM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.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:
> 0000003B00000004000000FC.00000020.backup).
>
> 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.

Yeah, I think you're right. If you omit pg_xlog from the base backup, as
we recommend in the manual, and clear the old files from the archive
too, then you won't have the old history file around.

I'll make pg_start_backup() to request xlog switch before the checkpoint
as you suggested. That's an easy fix that can be easily back-patched.

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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: BUG #4785: Installation fails
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file