Re: Backup history file should be replicated in Streaming Replication? - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Backup history file should be replicated in Streaming Replication?
Date
Msg-id 4B2BA7C9.30406@enterprisedb.com
Whole thread Raw
In response to Re: Backup history file should be replicated in Streaming Replication?  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Backup history file should be replicated in Streaming Replication?  (Robert Haas <robertmhaas@gmail.com>)
Re: Backup history file should be replicated in Streaming Replication?  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Fujii Masao wrote:
> pg_stop_backup deletes the previous backup history file from pg_xlog.
> So replication of a backup history file would fail if just one new
> online-backup is caused after the base-backup for the standby is taken.
> This is too aggressive deletion policy for Streaming Replication, I think.
> 
> So I'd like to change pg_stop_backup so as to delete only backup
> history files of four or more generations ago (four is enough?).

This is essentially the same problem we have with WAL files and
checkpoints. If the standby falls behind too much, without having on
open connection to the master all the time, the master will delete old
files that are still needed in the standby.

I don't think it's worthwhile to modify pg_stop_backup() like that. We
should address the general problem. At the moment, you're fine if you
also configure WAL archiving and log file shipping, but it would be nice
to have some simpler mechanism to avoid the problem. For example, a GUC
in master to retain all log files (including backup history files) for X
days. Or some way for to register the standby with the master so that
the master knows it's out there, and still needs the logs, even when
it's not connected.

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


pgsql-hackers by date:

Previous
From: Florian Weimer
Date:
Subject: Re: Update on true serializable techniques in MVCC
Next
From: Robert Haas
Date:
Subject: Re: Backup history file should be replicated in Streaming Replication?