Re: Add “FOR UPDATE NOWAIT” lock details to the log.
Yuki Seino <seinoyu@oss.nttdata.com>
From: Yuki Seino <seinoyu@oss.nttdata.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>,
Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-02-28T12:08:01Z
Lists: pgsql-hackers
Attachments
- v7-0001_add_log_lock_failure.patch (text/plain) patch v7
On 2025/02/27 15:44, Yuki Seino wrote: > (4) > https://github.com/postgres/postgres/blob/master/src/backend/access/heap/heapam_handler.c#L463 > > ...I don't know how to reproduce it. I have confirmed that (4) can be reproduced using the following procedure. (4) https://github.com/postgres/postgres/blob/master/src/backend/access/heap/heapam_handler.c#L463 tx1=# SELECT pg_advisory_lock(0); tx2=# SELECT * FROM pgbench_accounts WHERE pg_advisory_lock(0) IS NOT NULL FOR UPDATE NOWAIT; tx1=# UPDATE pgbench_accounts SET aid = aid WHERE aid = '1'; tx1=# BEGIN; tx1=# UPDATE pgbench_accounts SET aid = aid WHERE aid = '1'; tx1=# SELECT pg_advisory_unlock(0); Send the modified patch. Regard,
Commits
-
Rename log_lock_failure GUC to log_lock_failures for consistency.
- 73bdcfab35ec 18.0 landed
-
Add GUC option to log lock acquisition failures.
- 6d376c3b0d1e 18.0 landed
-
Split ProcSleep function into JoinWaitQueue and ProcSleep
- 3c0fd64fec8e 18.0 cited