pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: When fetching WAL for a basebackup, report errors with a sensibl
Date: Fri, 29 Oct 2021 18:09:48 +0000
Message-ID: <E1mgWK4-0001HQ-2r@gemulon.postgresql.org> (raw)

When fetching WAL for a basebackup, report errors with a sensible TLI.

The previous code used ThisTimeLineID, which need not even be
initialized here, although it usually was in practice, because
pg_basebackup issues IDENTIFY_SYSTEM before calling BASE_BACKUP,
and that initializes ThisTimeLineID as a side effect. That's not
really good enough, though, not only because we shoudn't be counting
on side effects like that, but also because the TLI could change
meanwhile. Fortunately, we have convenient access to more meaningful
TLI values, so use those instead.

Because of the way this logic is coded, the consequences of using
a possibly-incorrect TLI here are no worse than a slightly confusing
error message, I don't want to take any risk here, so no back-patch
at least for now.

Patch by me, reviewed by Kyotaro Horiguchi and Michael Paquier

Discussion: http://postgr.es/m/CA+TgmoZRNWGWYDX9RgTXMG6_nwSdB=PB-PPRUbvMUTGfmL2sHQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2f5c4397c39dea49c5608ba583868e26d767fc32

Modified Files
--------------
src/backend/replication/basebackup.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)



Message-ID: <E1mgWK4-0001HQ-2r@gemulon.postgresql.org>
Permalink:  ../E1mgWK4-0001HQ-2r@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mgWK4-0001HQ-2r@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: rhaas@postgresql.org
  Subject: Re: pgsql: When fetching WAL for a basebackup, report errors with a sensibl
  In-Reply-To: <E1mgWK4-0001HQ-2r@gemulon.postgresql.org>
  References: <E1mgWK4-0001HQ-2r@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