diff options
author | Andres Freund | 2022-04-07 01:26:17 +0000 |
---|---|---|
committer | Andres Freund | 2022-04-07 01:38:24 +0000 |
commit | e41aed674f35c63380175bb0e2dfa8dccfb2204d (patch) | |
tree | 2df5379b72989cd9c77a50fa9f4e995fed7e1e89 /src/include/pgstat.h | |
parent | 8b1dccd37c71ed2ff016294d8f9053a32b02b19e (diff) |
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
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r-- | src/include/pgstat.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 7981a816565..0c618e77103 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -1137,9 +1137,10 @@ extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id); */ extern void pgstat_reset_replslot(const char *name); -extern void pgstat_report_replslot(const PgStat_StatReplSlotEntry *repSlotStat); -extern void pgstat_report_replslot_create(const char *slotname); -extern void pgstat_report_replslot_drop(const char *slotname); +struct ReplicationSlot; +extern void pgstat_report_replslot(struct ReplicationSlot *slot, const PgStat_StatReplSlotEntry *repSlotStat); +extern void pgstat_create_replslot(struct ReplicationSlot *slot); +extern void pgstat_drop_replslot(struct ReplicationSlot *slot); /* |