pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix backup manifests to generate correct WAL-Ranges across timel
Date: Mon, 23 Aug 2021 02:10:36 +0000
Message-ID: <E1mHzQ4-0002nT-9g@gemulon.postgresql.org> (raw)

Fix backup manifests to generate correct WAL-Ranges across timelines

In a backup manifest, WAL-Ranges stores the range of WAL that is
required for the backup to be valid.  pg_verifybackup would then
internally use pg_waldump for the checks based on this data.

When the timeline where the backup started was more than 1 with a
history file looked at for the manifest data generation, the calculation
of the WAL range for the first timeline to check was incorrect.  The
previous logic used as start LSN the start position of the first
timeline, but it needs to use the start LSN of the backup.  This would
cause failures with pg_verifybackup, or any tools making use of the
backup manifests.

This commit adds a test based on a logic using a self-promoted node,
making it rather cheap.

Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/20210818.143031.1867083699202617521.horikyota.ntt@gmail.com
Backpatch-through: 13

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/65b649fecb0c0bd2c2c1f075f94f45a74cdc41be

Modified Files
--------------
src/backend/replication/backup_manifest.c | 15 +++++++++++----
src/bin/pg_verifybackup/t/007_wal.pl      | 19 ++++++++++++++++++-
2 files changed, 29 insertions(+), 5 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1mHzQ4-0002nT-9g@gemulon.postgresql.org>
Permalink:  ../E1mHzQ4-0002nT-9g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mHzQ4-0002nT-9g@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix backup manifests to generate correct WAL-Ranges across timel
  In-Reply-To: <E1mHzQ4-0002nT-9g@gemulon.postgresql.org>
  References: <E1mHzQ4-0002nT-9g@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox