v5-0005-wait_event_arg-report-number-of-spinlock-delays-f.patch
text/x-patch
Filename: v5-0005-wait_event_arg-report-number-of-spinlock-delays-f.patch
Type: text/x-patch
Part: 3
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v5-0005
Subject: wait_event_arg: report number of spinlock delays for Timeout/SpinDelay wait
| File | + | − |
|---|---|---|
| src/backend/storage/lmgr/s_lock.c | 1 | 1 |
| src/backend/utils/activity/wait_event_names.txt | 1 | 1 |
From 5d747a3ca443534937086f10831747953cdf162a Mon Sep 17 00:00:00 2001 From: Jakub Wartak <jakub.wartak@enterprisedb.com> Date: Wed, 11 Feb 2026 13:48:31 +0100 Subject: [PATCH v5 5/6] wait_event_arg: report number of spinlock delays for Timeout/SpinDelay wait --- src/backend/storage/lmgr/s_lock.c | 2 +- src/backend/utils/activity/wait_event_names.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c index e51c359409f..10c66e3666a 100644 --- a/src/backend/storage/lmgr/s_lock.c +++ b/src/backend/storage/lmgr/s_lock.c @@ -145,7 +145,7 @@ perform_spin_delay(SpinDelayStatus *status) * We might want to report something more granular at some point, but * this is better than nothing. */ - pgstat_report_wait_start(WAIT_EVENT_SPIN_DELAY); + pgstat_report_wait_start(WAIT_EVENT_SPIN_DELAY | status->delays); pg_usleep(status->cur_delay); pgstat_report_wait_end(); diff --git a/src/backend/utils/activity/wait_event_names.txt b/src/backend/utils/activity/wait_event_names.txt index 5438e048f0b..b86ebd3b2c2 100644 --- a/src/backend/utils/activity/wait_event_names.txt +++ b/src/backend/utils/activity/wait_event_names.txt @@ -181,7 +181,7 @@ PG_SLEEP "Waiting due to a call to <function>pg_sleep</function> or a sibling fu RECOVERY_APPLY_DELAY "Waiting to apply WAL during recovery because of a delay setting." RECOVERY_RETRIEVE_RETRY_INTERVAL "Waiting during recovery when WAL data is not available from any source (<filename>pg_wal</filename>, archive or stream)." REGISTER_SYNC_REQUEST "Waiting while sending synchronization requests to the checkpointer, because the request queue is full." -SPIN_DELAY "Waiting while acquiring a contended spinlock." +SPIN_DELAY "Waiting while acquiring a contended spinlock." "Number of spinlock delays." VACUUM_DELAY "Waiting in a cost-based vacuum delay point." VACUUM_TRUNCATE "Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed." WAL_SUMMARIZER_ERROR "Waiting after a WAL summarizer error." -- 2.43.0