Hi,

While I was reviewing replication slot statistics code, I found one
issue in the data type used for pgstat_report_replslot function
parameters. We pass int64 variables to the function but the function
prototype uses int type. I I felt the function parameters should be
int64. Attached patch fixes the same.
Thoughts?

Regards,
Vignesh
From d202d38357c6629efff112fbd56619b4f7f5b00d Mon Sep 17 00:00:00 2001
From: vignesh <vignes...@gmail.com>
Date: Thu, 1 Apr 2021 22:11:09 +0530
Subject: [PATCH v1] Data type correction in pgstat_report_replslot.

Data type correction in pgstat_report_replslot.
---
 src/backend/postmaster/pgstat.c | 5 +++--
 src/include/pgstat.h            | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 4b9bcd2b41..0b5affcf62 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -1773,8 +1773,9 @@ pgstat_report_tempfile(size_t filesize)
  * ----------
  */
 void
-pgstat_report_replslot(const char *slotname, int spilltxns, int spillcount,
-					   int spillbytes, int streamtxns, int streamcount, int streambytes)
+pgstat_report_replslot(const char *slotname, int64 spilltxns, int64 spillcount,
+					   int64 spillbytes, int64 streamtxns, int64 streamcount,
+					   int64 streambytes)
 {
 	PgStat_MsgReplSlot msg;
 
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index d699502cd9..1f87e668df 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -1450,8 +1450,10 @@ 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, int spilltxns, int spillcount,
-								   int spillbytes, int streamtxns, int streamcount, int streambytes);
+extern void pgstat_report_replslot(const char *slotname, int64 spilltxns,
+								   int64 spillcount, int64 spillbytes,
+								   int64 streamtxns, int64 streamcount,
+								   int64 streambytes);
 extern void pgstat_report_replslot_drop(const char *slotname);
 
 extern void pgstat_initialize(void);
-- 
2.25.1

Reply via email to