1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Use NameData datatype for slotname in stats.

This will make it consistent with the other usage of slotname in the code.
In the passing, change pgstat_report_replslot signature to use a structure
rather than multiple parameters.

Reported-by: Andres Freund
Author: Vignesh C
Reviewed-by: Sawada Masahiko, Amit Kapila
Discussion: https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de
This commit is contained in:
Amit Kapila
2021-04-14 08:55:03 +05:30
parent 20661c15db
commit cca57c1d9b
5 changed files with 36 additions and 29 deletions

View File

@ -393,7 +393,7 @@ typedef struct PgStat_MsgResetslrucounter
typedef struct PgStat_MsgResetreplslotcounter
{
PgStat_MsgHdr m_hdr;
char m_slotname[NAMEDATALEN];
NameData m_slotname;
bool clearall;
} PgStat_MsgResetreplslotcounter;
@ -540,7 +540,7 @@ typedef struct PgStat_MsgSLRU
typedef struct PgStat_MsgReplSlot
{
PgStat_MsgHdr m_hdr;
char m_slotname[NAMEDATALEN];
NameData m_slotname;
bool m_drop;
PgStat_Counter m_spill_txns;
PgStat_Counter m_spill_count;
@ -917,7 +917,7 @@ typedef struct PgStat_SLRUStats
*/
typedef struct PgStat_ReplSlotStats
{
char slotname[NAMEDATALEN];
NameData slotname;
PgStat_Counter spill_txns;
PgStat_Counter spill_count;
PgStat_Counter spill_bytes;
@ -1027,10 +1027,7 @@ extern void pgstat_report_recovery_conflict(int reason);
extern void pgstat_report_deadlock(void);
extern void pgstat_report_checksum_failures_in_db(Oid dboid, int failurecount);
extern void pgstat_report_checksum_failure(void);
extern void pgstat_report_replslot(const char *slotname, PgStat_Counter spilltxns,
PgStat_Counter spillcount, PgStat_Counter spillbytes,
PgStat_Counter streamtxns, PgStat_Counter streamcount,
PgStat_Counter streambytes);
extern void pgstat_report_replslot(const PgStat_ReplSlotStats *repSlotStat);
extern void pgstat_report_replslot_drop(const char *slotname);
extern void pgstat_initialize(void);