pgsql: Fix possible pg_basebackup failure on standby with "include WAL"

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible pg_basebackup failure on standby with "include WAL"
Date: 2016-10-27 16:15:05
Message-ID: E1bznKb-0001YJ-QF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
------
REL9_4_STABLE

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

Modified Files
--------------
src/backend/access/transam/xlog.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2016-10-27 19:03:51 pgsql: If the stats collector dies during Hot Standby, restart it.
Previous Message Bruce Momjian 2016-10-27 13:48:37 Re: pgsql: Properly indent postgresql.conf comments to align