Re: Error when running pg_basebackup

From: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>
To: "Campbell, Lance" <lance(at)illinois(dot)edu>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Error when running pg_basebackup
Date: 2016-10-13 07:33:15
Message-ID: 8154f0c1-5ac3-8769-d0b6-81c65c666dd7@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 12/10/2016 21:31, Campbell, Lance wrote:
> PostgreSQL – 9.5.4
>
> Command that is being executed:
>
> pg_basebackup --host=localhost --xlog --gzip --write-recovery-conf
> --format=t --pgdata=${BACKUPS_HOME}/${BACKUP_DATE_TIME}
>
>
>
> Error message that appears at the very end of pg_basebackup:
>
> pg_basebackup: could not get transaction log end position from server:
> ERROR: requested WAL segment 00000001000001CD00000055 has already been
> removed
>
>
> How can I prevent this error from occurring?
>

You could use -X stream instead of --xlog (which is an alias for -X
fetch). This consumes two wal senders instead of one, but greatly
reduce the probability of having this error.

The only way to really prevent this error is using replication slots,
but the support for pg_basebackup is only available in 9.6.

--
Julien Rouhaud
http://dalibo.com - http://dalibo.org

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Poul Kristensen 2016-10-13 10:00:09 PostgresSQL 9.5 and systemd autorestart but without replication.
Previous Message Thomas Kellerer 2016-10-12 20:19:06 Re: Is Bi-Directional Replication (BDR) is fully integrated into PostgreSQL 9.6 or 9.7?