pgsql: Fix possible pg_basebackup failure on standby with "include WAL" - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Fix possible pg_basebackup failure on standby with "include WAL"
Date
Msg-id E1bznKb-0001YD-PY@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f267c1c2447bb8da6e4a6b2fcbb612762c3579a8

Modified Files
--------------
src/backend/access/transam/xlog.c     | 29 ++++++++++++++++++++++++++++-
src/test/recovery/t/001_stream_rep.pl |  5 +++++
2 files changed, 33 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Fix possible pg_basebackup failure on standby with "include WAL"
Next
From: Robert Haas
Date:
Subject: pgsql: Fix possible pg_basebackup failure on standby with "include WAL"