diff options
author | Robert Haas | 2017-08-05 14:49:26 +0000 |
---|---|---|
committer | Robert Haas | 2017-08-05 14:49:26 +0000 |
commit | 52f8a59dd953c6820baf153e97cf07d31b8ac1d6 (patch) | |
tree | b574cd6c92d372a4d885f53be5b1fdf8d57e75d3 /doc/src | |
parent | eccead9ed43dc6e653c76dce1d2f455d251bb00c (diff) |
Make pg_stop_backup's wait_for_archive flag work on standbys.
Previously, it had no effect. Now, if archive_mode=always, it will
work, and if not, you'll get a warning.
Masahiko Sawada, Michael Paquier, and Robert Haas. The patch as
submitted also changed the behavior so that we would write and remove
history files on standbys, but that seems like material for a separate
patch to me.
Discussion: http://postgr.es/m/CAD21AoC2Xw6M=ZJyejq_9d_iDkReC_=rpvQRw5QsyzKQdfYpkw@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/backup.sgml | 13 | ||||
-rw-r--r-- | doc/src/sgml/func.sgml | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 7820de931c..0e7c6e2051 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1012,10 +1012,15 @@ SELECT pg_start_backup('label', true); <programlisting> SELECT pg_stop_backup(); </programlisting> - This terminates the backup mode and performs an automatic switch to - the next WAL segment. The reason for the switch is to arrange for - the last WAL segment file written during the backup interval to be - ready to archive. + This function, when called on a primary, terminates the backup mode and + performs an automatic switch to the next WAL segment. The reason for the + switch is to arrange for the last WAL segment written during the backup + interval to be ready to archive. When called on a standby, this function + only terminates backup mode. A subsequent WAL segment switch will be + needed in order to ensure that all WAL files needed to restore the backup + can be archived; if the primary does not have sufficient write activity + to trigger one, <function>pg_switch_wal</function> should be executed on + the primary. </para> </listitem> <listitem> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 36319222e6..b43ec30a4e 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -18597,7 +18597,12 @@ postgres=# select pg_start_backup('label_goes_here'); WAL to be archived. This behavior is only useful for backup software which independently monitors WAL archiving. Otherwise, WAL required to make the backup consistent might be missing and make the backup - useless. + useless. When this parameter is set to true, <function>pg_stop_backup</> + will wait for WAL to be archived when archiving is enabled; on the standby, + this means that it will wait only when <varname>archive_mode = always</>. + If write activity on the primary is low, it may be useful to run + <function>pg_switch_wal</> on the primary in order to trigger + an immediate segment switch. </para> <para> |