public inbox for [email protected]
help / color / mirror / Atom feedFrom: Fujii Masao <[email protected]>
To: [email protected]
Subject: pgsql: Add GUC option to log lock acquisition failures.
Date: Fri, 14 Mar 2025 14:16:29 +0000
Message-ID: <[email protected]> (raw)
Add GUC option to log lock acquisition failures.
This commit introduces a new GUC, log_lock_failure, which controls whether
a detailed log message is produced when a lock acquisition fails. Currently,
it only supports logging lock failures caused by SELECT ... NOWAIT.
The log message includes information about all processes holding or
waiting for the lock that couldn't be acquired, helping users analyze and
diagnose the causes of lock failures.
Currently, this option does not log failures from SELECT ... SKIP LOCKED,
as that could generate excessive log messages if many locks are skipped,
causing unnecessary noise.
This mechanism can be extended in the future to support for logging
lock failures from other commands, such as LOCK TABLE ... NOWAIT.
Author: Yuki Seino <[email protected]>
Co-authored-by: Fujii Masao <[email protected]>
Reviewed-by: Jelte Fennema-Nio <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6d376c3b0d1e79c318d2a1c04097025784e28377
Modified Files
--------------
doc/src/sgml/config.sgml | 20 ++++
src/backend/access/heap/heapam.c | 33 ++++---
src/backend/access/heap/heapam_handler.c | 4 +-
src/backend/storage/lmgr/lmgr.c | 33 ++++---
src/backend/storage/lmgr/lock.c | 55 ++++++++++-
src/backend/storage/lmgr/proc.c | 129 ++++++++++++++++----------
src/backend/utils/misc/guc_tables.c | 9 ++
src/backend/utils/misc/postgresql.conf.sample | 1 +
src/include/storage/lmgr.h | 5 +-
src/include/storage/lock.h | 4 +-
src/include/storage/proc.h | 4 +
11 files changed, 211 insertions(+), 86 deletions(-)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Add GUC option to log lock acquisition failures.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox