pgsql: Rationalize GetWalRcv{Write,Flush}RecPtr().

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Rationalize GetWalRcv{Write,Flush}RecPtr().
Date: 2020-04-08 11:55:51
Message-ID: E1jM9J9-00073x-Os@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Rationalize GetWalRcv{Write,Flush}RecPtr().

GetWalRcvWriteRecPtr() previously reported the latest *flushed*
location. Adopt the conventional terminology used elsewhere in the tree
by renaming it to GetWalRcvFlushRecPtr(), and likewise for some related
variables that used the term "received".

Add a new definition of GetWalRcvWriteRecPtr(), which returns the latest
*written* value. This will allow later patches to use the value for
non-data-integrity purposes, without having to wait for the flush
pointer to advance.

Reviewed-by: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/CA%2BhUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq%3DAovOddfHpA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d140f2f3e225ea53e2d92ab6833b8c186c90666c

Modified Files
--------------
src/backend/access/transam/xlog.c | 20 ++++++++++----------
src/backend/access/transam/xlogfuncs.c | 2 +-
src/backend/replication/README | 2 +-
src/backend/replication/walreceiver.c | 15 ++++++++++-----
src/backend/replication/walreceiverfuncs.c | 24 ++++++++++++++++++------
src/backend/replication/walsender.c | 2 +-
src/include/replication/walreceiver.h | 18 ++++++++++++++----
7 files changed, 55 insertions(+), 28 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-04-08 15:23:59 pgsql: Fix pg_dump/pg_restore to restore event trigger comments later.
Previous Message Peter Eisentraut 2020-04-08 09:23:41 pgsql: Allow publishing partition changes via ancestors

Browse pgsql-hackers by date

  From Date Subject
Next Message Jehan-Guillaume de Rorthais 2020-04-08 11:58:30 Re: [BUG] non archived WAL removed during production crash recovery
Previous Message Thomas Munro 2020-04-08 11:27:56 Re: WIP: WAL prefetch (another approach)