Skip to content

Commit

Permalink
Count WAL flushes in walreceiver (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
petuhovskiy authored and tristan957 committed Aug 9, 2023
1 parent 73aef20 commit 23091c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/backend/replication/walreceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ WalReceiverMain(void)
if (endofwal)
break;

/*
* Update WAL statistics, which are produced inside
* issue_xlog_fsync function. This is useful for counting
* WAL flushes, by querying pg_stat_wal.
*/
pgstat_send_wal(true);

/*
* Ideally we would reuse a WaitEventSet object repeatedly
* here to avoid the overheads of WaitLatchOrSocket on epoll
Expand Down

0 comments on commit 23091c5

Please sign in to comment.