diff options
author | Thomas Munro <tmunro@postgresql.org> | 2023-10-13 16:43:22 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2023-10-13 16:43:22 +1300 |
commit | 0013ba290b6684d095d93517ff2ca1fadf79bdb9 (patch) | |
tree | 19ee8a4489ce78072a07277260ec30be8bf24be3 /src/backend/access/transam/xlog.c | |
parent | 7e1f544827ec843918f189765863269ff3a1c77e (diff) | |
download | postgresql-0013ba290b6684d095d93517ff2ca1fadf79bdb9.tar.gz postgresql-0013ba290b6684d095d93517ff2ca1fadf79bdb9.zip |
Add wait events for checkpoint delay mechanism.
When MyProc->delayChkptFlags is set to temporarily block phase
transitions in a concurrent checkpoint, the checkpointer enters a
sleep-poll loop to wait for the flag to be cleared. We should show that
as a wait event in the pg_stat_activity view.
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CA%2BhUKGL7Whi8iwKbzkbn_1fixH3Yy8aAPz7mfq6Hpj7FeJrKMg%40mail.gmail.com
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 39aec70b625..07cf7662ff8 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6737,7 +6737,9 @@ CreateCheckPoint(int flags) { do { + pgstat_report_wait_start(WAIT_EVENT_CHECKPOINT_DELAY_START); pg_usleep(10000L); /* wait for 10 msec */ + pgstat_report_wait_end(); } while (HaveVirtualXIDsDelayingChkpt(vxids, nvxids, DELAY_CHKPT_START)); } @@ -6750,7 +6752,9 @@ CreateCheckPoint(int flags) { do { + pgstat_report_wait_start(WAIT_EVENT_CHECKPOINT_DELAY_COMPLETE); pg_usleep(10000L); /* wait for 10 msec */ + pgstat_report_wait_end(); } while (HaveVirtualXIDsDelayingChkpt(vxids, nvxids, DELAY_CHKPT_COMPLETE)); } |