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

From Michael Paquier
Subject Soften pg_[start|stop]_backup to allow them on a standby?
Date
Msg-id CAB7nPqR-0asnHiBTnK3Se7mL-N7RW=hbBOHwCCPygVfHHYEnvw@mail.gmail.com
Whole thread Raw
Responses Re: Soften pg_[start|stop]_backup to allow them on a standby?  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Hi all,

This is perhaps something that has already been discussed on hackers,
I just could not find anything in the archives.
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.

Could we consider soften the rules of pg_start_backup and
pg_stop_backup (aka allow creation of a backup_label file) to be able
to run them on a standby? Or not? This could accelerate taking backups
from standbys when taking backups locally.

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?

Note that pg_basebackup uses the command BASE_BACKUP to bypass that
and send directly the label file through a stream without writing it
to disk, satisfying this condition and making possible the creation of
backups from a standby.

Regards,
-- 
Michael



pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Disallow arrays with non-standard lower bounds
Next
From: Dilip kumar
Date:
Subject: Case sensitive mode in windows build option