]> granicus.if.org Git - postgresql/commit
Fix possible pg_basebackup failure on standby with "include WAL".
authorRobert Haas <rhaas@postgresql.org>
Thu, 27 Oct 2016 15:19:51 +0000 (11:19 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 27 Oct 2016 16:14:07 +0000 (12:14 -0400)
commit629575fa2da95943d491f3f821fd94413a78141b
tree0289016e0da3f5c025a5bc54fef825e5c1e784c9
parent1c8364f3ae328be3f1af90b3208d0b5f18b2c48b
Fix possible pg_basebackup failure on standby with "include WAL".

If a restartpoint flushed no dirty buffers, it could fail to update
the minimum recovery point, leading to a minimum recovery point prior
to the starting REDO location.  perform_base_backup() would interpret
that as meaning that no WAL files at all needed to be included in the
backup, failing an internal sanity check.  To fix, have restartpoints
always update the minimum recovery point to just after the checkpoint
record itself, so that the file (or files) containing the checkpoint
record will always be included in the backup.

Code by Amit Kapila, per a design suggestion by me, with some
additional work on the code comment by me.  Test case by Michael
Paquier.  Report by Kyotaro Horiguchi.
src/backend/access/transam/xlog.c