summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-10-02 12:39:35 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-10-02 12:49:29 +0300
commit0684d1949fb43ec21480db627cd13a282ca41f6e (patch)
tree9030b382901711d5fd921751e0013f696894fafe
parent55e188a15e8ab0fdafca8cc612f9e0d1a1802bde (diff)
Flush WAL stats in bgwriter
bgwriter can write out WAL, but did not flush the WAL pgstat counters, so the writes were not seen in pg_stat_wal. Back-patch to v14, where pg_stat_wal was introduced. Author: Nazir Bilal Yavuz Reviewed-by: Matthias van de Meent, Kyotaro Horiguchi Discussion: https://www.postgresql.org/message-id/CAN55FZ2FPYngovZstr%3D3w1KSEHe6toiZwrurbhspfkXe5UDocg%40mail.gmail.com
-rw-r--r--src/backend/postmaster/bgwriter.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index 91e6f6ea18a..470dd2673ca 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -242,6 +242,7 @@ BackgroundWriterMain(void)
/* Report pending statistics to the cumulative stats system */
pgstat_report_bgwriter();
+ pgstat_report_wal(true);
if (FirstCallSinceLastCheckpoint())
{