Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96bdb7e

Browse files
committed
Fix pgstat_report_replslot() to use proper data types for its arguments.
The caller of pgstat_report_replslot() passes int64 values to the function.Also the function stores those values in PgStat_Counter (i.e., int64) fieldsof PgStat_MsgReplSlot struct. But previously the function used "int" asthe data types of some arguments for those values, which could lead tothe overflow of values.To avoid this risk, this commit fixes pgstat_report_replslot() to usePgStat_Counter type for the arguments. Since they are the statistics counters,PgStat_Counter, the data type used for counters, is used for theminstead of int64.Reported-by: Vignesh CAuthor: Vignesh CReviewed-by: Jeevan Ladhe, Fujii MasaoDiscussion:https://postgr.es/m/CALDaNm080OpG=ZwOb0i8EyChH5SyHAMFWJCKaKTXmrfvJLbgaA@mail.gmail.com
1 parent6fb66c2 commit96bdb7e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,8 +1773,10 @@ pgstat_report_tempfile(size_t filesize)
17731773
* ----------
17741774
*/
17751775
void
1776-
pgstat_report_replslot(constchar*slotname,intspilltxns,intspillcount,
1777-
intspillbytes,intstreamtxns,intstreamcount,intstreambytes)
1776+
pgstat_report_replslot(constchar*slotname,PgStat_Counterspilltxns,
1777+
PgStat_Counterspillcount,PgStat_Counterspillbytes,
1778+
PgStat_Counterstreamtxns,PgStat_Counterstreamcount,
1779+
PgStat_Counterstreambytes)
17781780
{
17791781
PgStat_MsgReplSlotmsg;
17801782

‎src/include/pgstat.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,8 +1450,10 @@ extern void pgstat_report_recovery_conflict(int reason);
14501450
externvoidpgstat_report_deadlock(void);
14511451
externvoidpgstat_report_checksum_failures_in_db(Oiddboid,intfailurecount);
14521452
externvoidpgstat_report_checksum_failure(void);
1453-
externvoidpgstat_report_replslot(constchar*slotname,intspilltxns,intspillcount,
1454-
intspillbytes,intstreamtxns,intstreamcount,intstreambytes);
1453+
externvoidpgstat_report_replslot(constchar*slotname,PgStat_Counterspilltxns,
1454+
PgStat_Counterspillcount,PgStat_Counterspillbytes,
1455+
PgStat_Counterstreamtxns,PgStat_Counterstreamcount,
1456+
PgStat_Counterstreambytes);
14551457
externvoidpgstat_report_replslot_drop(constchar*slotname);
14561458

14571459
externvoidpgstat_initialize(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp