]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix pg_rewind bugs when rewinding a standby server.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 3 Dec 2020 13:57:48 +0000 (15:57 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 3 Dec 2020 13:58:06 +0000 (15:58 +0200)
commit81e3c868f891bf291a3ad38d81b04096146c2f6f
treed06209821dfed5a9a8f04c856bbe63660fb208c2
parentfb500296dfa6cffdd4dfdc8175e2173c6074f20a
Fix pg_rewind bugs when rewinding a standby server.

If the target is a standby server, its WAL doesn't end at the last
checkpoint record, but at minRecoveryPoint. We must scan all the
WAL from the last common checkpoint all the way up to minRecoveryPoint
for modified pages, and also consider that portion when determining
whether the server needs rewinding.

Backpatch to all supported versions.

Author: Ian Barwick and me
Discussion: https://www.postgresql.org/message-id/CABvVfJU-LDWvoz4-Yow3Ay5LZYTuPD7eSjjE4kGyNZpXC6FrVQ%40mail.gmail.com
src/bin/pg_rewind/parsexlog.c
src/bin/pg_rewind/pg_rewind.c
src/bin/pg_rewind/t/008_min_recovery_point.pl [new file with mode: 0644]