aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2022-07-26 16:02:43 +0900
committerFujii Masao <fujii@postgresql.org>2022-07-26 16:02:43 +0900
commit3cabe45a819f8a2a282d9d57e45f259c84e97c3f (patch)
tree5a20e5cb766b5cb39fe89a9a4cb58f1b517f90f1
parent756e221db610f333649385f7fef96e7e9e23ed71 (diff)
downloadpostgresql-3cabe45a819f8a2a282d9d57e45f259c84e97c3f.tar.gz
postgresql-3cabe45a819f8a2a282d9d57e45f259c84e97c3f.zip
doc: Add note about re-archiving of same WAL files in docs.
The server may attempt to re-archive a WAL file that was previously archived. This commit adds the note about how an archive library should handle such a re-archiving. Author: Nathan Bossart Reviewed-by: David Steele, Kyotaro Horiguchi Discussion: https://postgr.es/m/CA+TgmoaeTe4oUT39A4nt=8LD6UJ5u0vcmGc5+Aksn-4oKRb8-w@mail.gmail.com
-rw-r--r--doc/src/sgml/backup.sgml25
1 files changed, 20 insertions, 5 deletions
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml
index 73a774d3d7f..e432bb015a6 100644
--- a/doc/src/sgml/backup.sgml
+++ b/doc/src/sgml/backup.sgml
@@ -681,14 +681,29 @@ test ! -f /mnt/server/archivedir/00000001000000A900000065 &amp;&amp; cp pg_wal/0
any pre-existing archive file. This is an important safety feature to
preserve the integrity of your archive in case of administrator error
(such as sending the output of two different servers to the same archive
- directory).
+ directory). It is advisable to test your proposed archive library to ensure
+ that it does not overwrite an existing file.
</para>
<para>
- It is advisable to test your proposed archive library to ensure that it
- indeed does not overwrite an existing file, <emphasis>and that it returns
- <literal>false</literal> in this case</emphasis>.
- The example command above for Unix ensures this by including a separate
+ In rare cases, <productname>PostgreSQL</productname> may attempt to
+ re-archive a WAL file that was previously archived. For example, if the
+ system crashes before the server makes a durable record of archival success,
+ the server will attempt to archive the file again after restarting (provided
+ archiving is still enabled). When an archive library encounters a
+ pre-existing file, it may return <literal>true</literal> if the WAL file has
+ identical contents to the pre-existing archive and the pre-existing archive
+ is fully persisted to storage. Alternatively, the archive library may
+ return <literal>false</literal> anytime a pre-existing file is encountered,
+ but this will require manual action by an administrator to resolve. If a
+ pre-existing file contains different contents than the WAL file being
+ archived, the archive library <emphasis>must</emphasis> return
+ <literal>false</literal>.
+ </para>
+
+ <para>
+ The example command above for Unix avoids overwriting a pre-existing archive
+ by including a separate
<command>test</command> step. On some Unix platforms, <command>cp</command> has
switches such as <option>-i</option> that can be used to do the same thing
less verbosely, but you should not rely on these without verifying that