On Thu, Apr 1, 2021 at 11:18 PM Fujii Masao <masao.fu...@oss.nttdata.com> wrote:
>
>
>
> On 2021/04/02 2:18, Jeevan Ladhe wrote:
> >
> >
> > On Thu, Apr 1, 2021 at 10:20 PM vignesh C <vignes...@gmail.com 
> > <mailto:vignes...@gmail.com>> wrote:
> >
> >     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.
>
> Isn't it better to use PgStat_Counter instead of int64?
>

Thanks for your comment, the updated patch contains the changes for it.

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

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

diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 4b9bcd2b41..2f3f378e63 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -1773,8 +1773,10 @@ 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, PgStat_Counter spilltxns,
+					   PgStat_Counter spillcount, PgStat_Counter spillbytes,
+					   PgStat_Counter streamtxns, PgStat_Counter streamcount,
+					   PgStat_Counter streambytes)
 {
 	PgStat_MsgReplSlot msg;
 
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index d699502cd9..fe6683cf5c 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, PgStat_Counter spilltxns,
+								   PgStat_Counter spillcount, PgStat_Counter spillbytes,
+								   PgStat_Counter streamtxns, PgStat_Counter streamcount,
+								   PgStat_Counter streambytes);
 extern void pgstat_report_replslot_drop(const char *slotname);
 
 extern void pgstat_initialize(void);
-- 
2.25.1

Reply via email to