Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start - Mailing list pgsql-general

From Michael Paquier
Subject Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start
Date
Msg-id CAB7nPqSV-A8gm8EgnkmG+xVnXA2rY_WUK1enH8xDqSyuoqGriw@mail.gmail.com
Whole thread Raw
In response to pg_basebackup vs archive_command - looking for WAL archive older than archive_command start  (Francisco Reyes <lists@natserv.net>)
List pgsql-general
On Mon, Jul 18, 2016 at 7:35 AM, Francisco Reyes <lists@natserv.net> wrote:
> I turned on archive_command and have wal archiving going.
>
> I did a pg_basebackup and copied the resulting file from source machine to
> target, yet when I restore I am getting
>
> requested WAL segment 00000005000008AE0000009B has already been removed

This is decided by the backup_label file located in the backup

> The earliest WAL archives I have are
>
> 00000005000008D20000005C.00000028.backup.gz
> 00000005000008D20000005C.gz
> 00000005000008D20000005D.gz
>
> Why is the pg_basebackup restore looking for a WAL file that is even older
> than the ones I have, when I turned on WAL archiving before I started the
> pg_basebackup?
>
> Also, why is that one WAL archive named differently with .backup?

This gives an indication where a backup has been taken. Depending on
the situation, like node promotion, there could be as well timeline
history files.

> Any suggestions?

It seems to me that you do not retain enough history, or simply that
you did not turn on WAL archiving before taking the base backup.. In
the current situation and you don't have those segments, the backup
you took is likely useless. It may not be able to reach a consistent
state.
--
Michael


pgsql-general by date:

Previous
From: Francisco Reyes
Date:
Subject: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start
Next
From: Francisco Reyes
Date:
Subject: Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start