Skip to content

Commit d7cbeaf

Browse files
committed
Remove pgstat_flush_wal()
All the processes that generate WAL should call pgstat_report_wal() to report all their statistics related to WAL, and this is already what happens in the tree. Keeping pgstat_report_wal() is confusing while the other routine is encouraged. This routine is not required since fc415ed, where it was lastly used in pgstat_report_stat() before an equivalent callback existed. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/Z71oPkJJICrRB5Ws@paquier.xyz
1 parent e117cfb commit d7cbeaf

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/backend/utils/activity/pgstat_wal.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pgstat_report_wal(bool force)
5151
nowait = !force;
5252

5353
/* flush wal stats */
54-
pgstat_flush_wal(nowait);
54+
(void) pgstat_wal_flush_cb(nowait);
5555

5656
/* flush IO stats */
5757
pgstat_flush_io(nowait);
@@ -69,15 +69,6 @@ pgstat_fetch_stat_wal(void)
6969
return &pgStatLocal.snapshot.wal;
7070
}
7171

72-
/*
73-
* Simple wrapper of pgstat_wal_flush_cb()
74-
*/
75-
void
76-
pgstat_flush_wal(bool nowait)
77-
{
78-
(void) pgstat_wal_flush_cb(nowait);
79-
}
80-
8172
/*
8273
* Calculate how much WAL usage counters have increased by subtracting the
8374
* previous counters from the current ones.

src/include/utils/pgstat_internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,6 @@ extern void pgstat_slru_snapshot_cb(void);
748748
* Functions in pgstat_wal.c
749749
*/
750750

751-
extern void pgstat_flush_wal(bool nowait);
752-
753751
extern void pgstat_wal_init_backend_cb(void);
754752
extern bool pgstat_wal_have_pending_cb(void);
755753
extern bool pgstat_wal_flush_cb(bool nowait);

0 commit comments

Comments
 (0)