mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-23 14:57:03 +08:00
Add slotsync skip statistics.
This patch adds two new columns to the pg_stat_replication_slots view: slotsync_skip_count - the total number of times a slotsync operation was skipped. slotsync_skip_at - the timestamp of the most recent skip. These additions provide better visibility into replication slot synchronization behavior. A future patch will introduce the slotsync_skip_reason column in pg_replication_slots to capture the reason for skip. Author: Shlok Kyal <shlok.kyal.oss@gmail.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Ashutosh Sharma <ashu.coek88@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/CAE9k0PkhfKrTEAsGz4DjOhEj1nQ+hbQVfvWUxNacD38ibW3a1g@mail.gmail.com
This commit is contained in:
@ -214,7 +214,7 @@ typedef struct PgStat_TableXactStatus
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define PGSTAT_FILE_FORMAT_ID 0x01A5BCBA
|
||||
#define PGSTAT_FILE_FORMAT_ID 0x01A5BCBB
|
||||
|
||||
typedef struct PgStat_ArchiverStats
|
||||
{
|
||||
@ -400,6 +400,8 @@ typedef struct PgStat_StatReplSlotEntry
|
||||
PgStat_Counter mem_exceeded_count;
|
||||
PgStat_Counter total_txns;
|
||||
PgStat_Counter total_bytes;
|
||||
PgStat_Counter slotsync_skip_count;
|
||||
TimestampTz slotsync_skip_at;
|
||||
TimestampTz stat_reset_timestamp;
|
||||
} PgStat_StatReplSlotEntry;
|
||||
|
||||
@ -745,6 +747,7 @@ extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
|
||||
extern void pgstat_reset_replslot(const char *name);
|
||||
struct ReplicationSlot;
|
||||
extern void pgstat_report_replslot(struct ReplicationSlot *slot, const PgStat_StatReplSlotEntry *repSlotStat);
|
||||
extern void pgstat_report_replslotsync(struct ReplicationSlot *slot);
|
||||
extern void pgstat_create_replslot(struct ReplicationSlot *slot);
|
||||
extern void pgstat_acquire_replslot(struct ReplicationSlot *slot);
|
||||
extern void pgstat_drop_replslot(struct ReplicationSlot *slot);
|
||||
|
||||
Reference in New Issue
Block a user