Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Francisco Reyes <lists(at)natserv(dot)net>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start
Date: 2016-07-17 22:48:01
Message-ID: CAB7nPqSV-A8gm8EgnkmG+xVnXA2rY_WUK1enH8xDqSyuoqGriw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jul 18, 2016 at 7:35 AM, Francisco Reyes <lists(at)natserv(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Reyes 2016-07-17 23:03:59 Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start
Previous Message Francisco Reyes 2016-07-17 22:35:27 pg_basebackup vs archive_command - looking for WAL archive older than archive_command start