pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rework WAL-reading supporting structs
Date: Tue, 24 Sep 2019 19:46:52 +0000
Message-ID: <E1iCqlw-0006U7-4b@gemulon.postgresql.org> (raw)

Rework WAL-reading supporting structs

The state-tracking of WAL reading in various places was pretty messy,
mostly because the ancient physical-replication WAL reading code wasn't
using the XLogReader abstraction.  This led to some untidy code.  Make
it prettier by creating two additional supporting structs,
WALSegmentContext and WALOpenSegment which keep track of WAL-reading
state.  This makes code cleaner, as well as supports more future
cleanup.

Author: Antonin Houska
Reviewed-by: Álvaro Herrera and (older versions) Robert Haas
Discussion: https://postgr.es/m/14984.1554998742@spoje.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/709d003fbd98b975a4fbcb4c5750fa6efaf9ad87

Modified Files
--------------
src/backend/access/transam/twophase.c          |   5 +-
src/backend/access/transam/xlog.c              |  17 +++--
src/backend/access/transam/xlogreader.c        |  73 +++++++++++-------
src/backend/access/transam/xlogutils.c         |  30 ++++----
src/backend/replication/logical/logical.c      |   2 +-
src/backend/replication/logical/logicalfuncs.c |   4 +-
src/backend/replication/walsender.c            | 102 ++++++++++++-------------
src/bin/pg_rewind/parsexlog.c                  |  21 ++---
src/bin/pg_waldump/pg_waldump.c                |  68 +++++++----------
src/include/access/xlogreader.h                |  41 ++++++----
src/include/access/xlogutils.h                 |   3 +-
src/include/replication/logicalfuncs.h         |   2 +-
12 files changed, 189 insertions(+), 179 deletions(-)



Message-ID: <E1iCqlw-0006U7-4b@gemulon.postgresql.org>
Permalink:  ../E1iCqlw-0006U7-4b@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iCqlw-0006U7-4b@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Rework WAL-reading supporting structs
  In-Reply-To: <E1iCqlw-0006U7-4b@gemulon.postgresql.org>
  References: <E1iCqlw-0006U7-4b@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