Add the system identifier to backup manifests.
authorRobert Haas
Wed, 13 Mar 2024 19:04:22 +0000 (15:04 -0400)
committerRobert Haas
Wed, 13 Mar 2024 19:12:33 +0000 (15:12 -0400)
commit2041bc4276c95ac014510032e622a4baf70b29f1
tree7fb89a55324b84f867d8cc1a1f83f3541c1ad484
parent1ee910ce437188eab40eddf32dc7d81952e99f82
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
16 files changed:
doc/src/sgml/backup-manifest.sgml
doc/src/sgml/ref/pg_verifybackup.sgml
src/backend/backup/backup_manifest.c
src/backend/backup/basebackup_incremental.c
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_combinebackup/load_manifest.c
src/bin/pg_combinebackup/load_manifest.h
src/bin/pg_combinebackup/pg_combinebackup.c
src/bin/pg_combinebackup/t/005_integrity.pl
src/bin/pg_combinebackup/write_manifest.c
src/bin/pg_combinebackup/write_manifest.h
src/bin/pg_verifybackup/pg_verifybackup.c
src/bin/pg_verifybackup/t/003_corruption.pl
src/bin/pg_verifybackup/t/005_bad_manifest.pl
src/common/parse_manifest.c
src/include/common/parse_manifest.h