Add prefix checks in exclude lists for pg_rewind, pg_checksums and base backups
authorMichael Paquier <michael@paquier.xyz>
Mon, 24 Feb 2020 09:13:25 +0000 (18:13 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 24 Feb 2020 09:13:25 +0000 (18:13 +0900)
commitbf883b211eae18662f2dfaede02f5d115bf0b805
tree28319a5b0af20d5b6a35948a5ab9afa4cebdfa6e
parent79c2385915dd4aa43127e766c3dce323ec562ba0
Add prefix checks in exclude lists for pg_rewind, pg_checksums and base backups

An instance of PostgreSQL crashing with a bad timing could leave behind
temporary pg_internal.init files, potentially causing failures when
verifying checksums.  As the same exclusion lists are used between
pg_rewind, pg_checksums and basebackup.c, all those tools are extended
with prefix checks to keep everything in sync, with dedicated checks
added for pg_internal.init.

Backpatch down to 11, where pg_checksums (pg_verify_checksums in 11) and
checksum verification for base backups have been introduced.

Reported-by: Michael Banck
Author: Michael Paquier
Reviewed-by: Kyotaro Horiguchi, David Steele
Discussion: https://postgr.es/m/62031974fd8e941dd8351fbc8c7eff60d59c5338.camel@credativ.de
Backpatch-through: 11
src/backend/replication/basebackup.c
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_checksums/pg_checksums.c
src/bin/pg_checksums/t/002_actions.pl
src/bin/pg_rewind/filemap.c