From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor WAL file-reading code into WALRead()
Date: Mon, 25 Nov 2019 18:07:55 +0000
Message-ID: <E1iZImB-0005dz-Pu@gemulon.postgresql.org> (raw)
Refactor WAL file-reading code into WALRead()
XLogReader, walsender and pg_waldump all had their own routines to read
data from WAL files to memory, with slightly different approaches
according to the particular conditions of each environment. There's a
lot of commonality, so we can refactor that into a single routine
WALRead in XLogReader, and move the differences to a separate (simpler)
callback that just opens the next WAL-segment. This results in a
clearer (ahem) code flow.
The error reporting needs are covered by filling in a new error-info
struct, WALReadError, and it's the caller's responsibility to act on it.
The backend has WALReadRaiseError() to do so.
We no longer ever need to seek in this interface; switch to using
pg_pread().
Author: Antonin Houska, with contributions from Álvaro Herrera
Reviewed-by: Michaël Paquier, Kyotaro Horiguchi
Discussion: https://postgr.es/m/14984.1554998742@spoje.net
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0dc8ead46363fec6f621a12c7e1f889ba73b55a9
Modified Files
--------------
src/backend/access/transam/xlogreader.c | 106 ++++++++++-
src/backend/access/transam/xlogutils.c | 205 ++++++++--------------
src/backend/replication/walsender.c | 300 +++++++++++++-------------------
src/bin/pg_waldump/pg_waldump.c | 168 ++++++------------
src/include/access/xlogreader.h | 39 ++++-
src/include/access/xlogutils.h | 2 +
6 files changed, 387 insertions(+), 433 deletions(-)
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: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Refactor WAL file-reading code into WALRead()
In-Reply-To: <E1iZImB-0005dz-Pu@gemulon.postgresql.org>
References: <E1iZImB-0005dz-Pu@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