Subject: pgsql: Fix ProcWakeup() resetting wrong waitStart field.

From: Fujii Masao <[email-masked]>
Date: Wed, 25 Feb 2026 23:51:22 +0000

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 <[email-masked]>
Author: Chao Li <[email-masked]>
Reviewed-by: ji xu <[email-masked]>
Reviewed-by: Álvaro Herrera <[email-masked]>
Discussion: https://postgr.es/m/[email-masked]
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/70f470314cb45578d929240dfd6be3a12003830e

Modified Files
--------------
src/backend/storage/lmgr/proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)