Re: Soften pg_[start|stop]_backup to allow them on a standby? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Soften pg_[start|stop]_backup to allow them on a standby?
Date
Msg-id 20140114125442.GA8537@awork2.anarazel.de
Whole thread Raw
In response to Soften pg_[start|stop]_backup to allow them on a standby?  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Soften pg_[start|stop]_backup to allow them on a standby?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

On 2014-01-14 12:31:09 +0900, Michael Paquier wrote:
> Currently, pg_start_backup and pg_stop_backup cannot run on a standby
> because it is not possible to write a backup_label file to disk,
> because of the nature of a standby server preventing to write any data
> in its PGDATA. Is this thought right? This is what the comments at the
> top of do_pg_start_backup make me conclude.

No, the actual reason is that a plain pg_stop_backup() writes WAL -
which we can't do on a standby. The walsender command gets around this
by storing the required data in the backup label itself, but that
requires the label to be written after the basebackup actually finished
which doesn't work for plain start/stop backup.

> Another idea would be to send the backup label file directly as the
> output of pg_start_backup such as client application can grab it and
> reuse it. Any thoughts about that as well?

Yea, I think extending the "protocols" available is the way to go
here. We need to be able to send the backup label after the actual base
backup finished.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Extending BASE_BACKUP in replication protocol: incremental backup and backup format
Next
From: Andres Freund
Date:
Subject: Re: Extending BASE_BACKUP in replication protocol: incremental backup and backup format