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: walmethods.c/h: Make Walfile a struct, rather than a void *
Date: Mon, 19 Sep 2022 15:26:04 +0000
Message-ID: <E1oaIep-0013rN-Kq@gemulon.postgresql.org> (raw)

walmethods.c/h: Make Walfile a struct, rather than a void *

This makes the curent file position and pathname visible in a generic
way, so we no longer need current_walfile_name global variable or the
get_current_pos() method. Since that purported to be able to fail but
never actually did, this also lets us get rid of some unnecessary
error-handling code.

One risk of this change is that the get_current_pos() method
previously cleared the error indicator, and that will no longer happen
with the new approach. I looked for a way that this could cause problems
and did not find one.

The previous code was confused about whether "Walfile" was the
implementation-dependent structure representing a WAL file or
whether it was a pointer to that stucture. Some of the code used it
one way, and some in the other. The compiler tolerated that because
void * is interchangeable with void **, but now that Walfile is a
struct, it's necessary to be consistent. Hence, some references to
"Walfile" have been converted to "Walfile *".

Discussion: http://postgr.es/m/CA+TgmoZS0Kw98fOoAcGz8B9iDhdqB4Be4e=vDZaJZ5A-xMYBqA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4fd14794945e60c4aedad84b06ff1e2a7a6236f0

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 48 ++++++++------------
src/bin/pg_basebackup/walmethods.c | 89 ++++++++++++++------------------------
src/bin/pg_basebackup/walmethods.h | 27 ++++++++----
3 files changed, 70 insertions(+), 94 deletions(-)



Message-ID: <E1oaIep-0013rN-Kq@gemulon.postgresql.org>
Permalink:  ../E1oaIep-0013rN-Kq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oaIep-0013rN-Kq@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: walmethods.c/h: Make Walfile a struct, rather than a void *
  In-Reply-To: <E1oaIep-0013rN-Kq@gemulon.postgresql.org>
  References: <E1oaIep-0013rN-Kq@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