From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgstat: revise replication slot API in preparation for shared me
Date: Thu, 07 Apr 2022 02:07:46 +0000
Message-ID: <E1ncHYo-000fJt-Bj@gemulon.postgresql.org> (raw)
pgstat: revise replication slot API in preparation for shared memory stats.
Previously the pgstat <-> replication slots API was done with on the basis of
names. However, the upcoming move to storing stats in shared memory makes it
more convenient to use a integer as key.
Change the replication slot functions to take the slot rather than the slot
name, and expose ReplicationSlotIndex() to compute the index of an replication
slot. Special handling will be required for restarts, as the index is not
stable across restarts. For now pgstat internally still uses names.
Rename pgstat_report_replslot_{create,drop}() to
pgstat_{create,drop}_replslot() to match the functions for other kinds of
stats.
Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20220404041516.cctrvpadhuriawlq@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e41aed674f35c63380175bb0e2dfa8dccfb2204d
Modified Files
--------------
src/backend/postmaster/pgstat.c | 10 +++++++++-
src/backend/replication/logical/logical.c | 2 +-
src/backend/replication/slot.c | 20 ++++++++++++++++++--
src/backend/utils/activity/pgstat_replslot.c | 13 ++++++++-----
src/include/pgstat.h | 7 ++++---
src/include/replication/slot.h | 1 +
6 files changed, 41 insertions(+), 12 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: andres@anarazel.de
Subject: Re: pgsql: pgstat: revise replication slot API in preparation for shared me
In-Reply-To: <E1ncHYo-000fJt-Bj@gemulon.postgresql.org>
References: <E1ncHYo-000fJt-Bj@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