]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix ProcWakeup() resetting wrong waitStart field.
authorFujii Masao <fujii@postgresql.org>
Wed, 25 Feb 2026 23:46:12 +0000 (08:46 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 25 Feb 2026 23:51:05 +0000 (08:51 +0900)
commit5d2dec77efaf98049b24efd716f5cc677405a9e2
tree6b8c6ef351d8236ec940bc6c06d4aea16138b134
parentff9bd96754f171a9277a13de7e0dea7349b57278
Fix ProcWakeup() resetting wrong waitStart field.

Previously, when one process woke another that was waiting on a lock,
ProcWakeup() incorrectly cleared its own waitStart field (i.e.,
MyProc->waitStart) instead of that of the process being awakened.
As a result, the awakened process retained a stale lock-wait start timestamp.

This did not cause user-visible issues. pg_locks.waitstart was reported as
NULL for the awakened process (i.e., when pg_locks.granted is true),
regardless of the waitStart value.

This bug was introduced by commit 46d6e5f56790.

This commit fixes this by resetting the waitStart field of the process
being awakened in ProcWakeup().

Backpatch to all supported branches.

Reported-by: Chao Li <li.evan.chao@gmail.com>
Author: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: ji xu <thanksgreed@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/537BD852-EC61-4D25-AB55-BE8BE46D07D7@gmail.com
Backpatch-through: 14
src/backend/storage/lmgr/proc.c