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: Improve some check logic in pg_receivewal
Date: Sat, 18 Sep 2021 01:50:59 +0000
Message-ID: <E1mRPVL-0008IY-6h@gemulon.postgresql.org> (raw)

Improve some check logic in pg_receivewal

The following things are improved:
- Fetch the system identifier from the source server before any
WAL streaming loop.  This triggers extra checks to make sure that
pg_receivewal is still connected to a server with the same system ID
with a correct timeline.
- Switch umask() (for file creation mode mask) and RetrieveWalSegSize()
(to fetch the size of WAL segments) a bit later before the initial
stream attempt.  If the connection was done with a database,
pg_receivewal would fail but those commands were still executed, which
was a waste.  The slot creation and drop are now done before retrieving
the segment size.

Author: Bharath Rupireddy
Reviewed-by: Ronan Dunklau, Michael Paquier
Discussion: https://postgr.es/m/CALj2ACX00YYeyBfoi55Cy=NrP-FcfMgiYYx1qRUEib3yjCVoaA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/499c9b1266395c5e4c22bd7b2cbdb7f5a64ea4fa

Modified Files
--------------
src/bin/pg_basebackup/pg_receivewal.c | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)



Message-ID: <E1mRPVL-0008IY-6h@gemulon.postgresql.org>
Permalink:  ../E1mRPVL-0008IY-6h@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mRPVL-0008IY-6h@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: Improve some check logic in pg_receivewal
  In-Reply-To: <E1mRPVL-0008IY-6h@gemulon.postgresql.org>
  References: <E1mRPVL-0008IY-6h@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