1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add the system identifier to backup manifests.

Before this patch, if you took a full backup on server A and then
tried to use the backup manifest to take an incremental backup on
server B, it wouldn't know that the manifest was from a different
server and so the incremental backup operation could potentially
complete without error. When you later tried to run pg_combinebackup,
you'd find out that your incremental backup was and always had been
invalid. That's poor timing, because nobody likes finding out about
backup problems only at restore time.

With this patch, you'll get an error when trying to take the (invalid)
incremental backup, which seems a lot nicer.

Amul Sul, revised by me. Review by Michael Paquier.

Discussion: http://postgr.es/m/CA+TgmoYLZzbSAMM3cAjV4Y+iCRZn-bR9H2+Mdz7NdaJFU1Zb5w@mail.gmail.com
This commit is contained in:
Robert Haas
2024-03-13 15:04:22 -04:00
parent 1ee910ce43
commit 2041bc4276
16 changed files with 351 additions and 23 deletions

View File

@ -37,7 +37,22 @@
<term><literal>PostgreSQL-Backup-Manifest-Version</literal></term>
<listitem>
<para>
The associated value is always the integer 1.
The associated value is an integer. Beginning in
<productname>PostgreSQL</productname> <literal>17</literal>,
it is <literal>2</literal>; in older versions, it is <literal>1</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>System-Identifier</literal></term>
<listitem>
<para>
The database system identifier of the
<productname>PostgreSQL</productname> instance where the backup was
taken. This field is present only when
<literal>PostgreSQL-Backup-Manifest-Version</literal> is
<literal>2</literal>.
</para>
</listitem>
</varlistentry>

View File

@ -53,9 +53,10 @@ PostgreSQL documentation
Backup verification proceeds in four stages. First,
<literal>pg_verifybackup</literal> reads the
<literal>backup_manifest</literal> file. If that file
does not exist, cannot be read, is malformed, or fails verification
against its own internal checksum, <literal>pg_verifybackup</literal>
will terminate with a fatal error.
does not exist, cannot be read, is malformed, fails to match the system
identifier with <filename>pg_control</filename> of the backup directory or
fails verification against its own internal checksum,
<literal>pg_verifybackup</literal> will terminate with a fatal error.
</para>
<para>