postgresql/src/backend
Fujii Masao b993706787 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 46d6e5f567.

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
2026-02-26 08:50:56 +09:00
..
access Don't reset 'latest_page_number' when replaying multixid truncation 2026-02-16 17:20:29 +02:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Fix error message related to end TLI in backup manifest 2026-01-18 17:25:01 +09:00
bootstrap Fix CREATE INDEX progress reporting for multi-level partitioning. 2023-03-25 15:34:03 -04:00
catalog Fix some cases of indirectly casting away const. 2026-02-25 11:19:50 -05:00
commands Harden _int_matchsel() against being attached to the wrong operator. 2026-02-09 10:14:22 -05:00
executor Fix bogus ctid requirement for dummy-root partitioned targets 2026-01-23 10:23:18 +09:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:28 -07:00
jit jit: Add missing inline pass for LLVM >= 17. 2026-01-22 16:10:08 +13:00
lib Accommodate very large dshash tables. 2024-12-17 15:24:45 -06:00
libpq Fix build breakage on Solaris-alikes with late-model GCC. 2025-07-23 15:44:29 -04:00
main Avoid possible crash within libsanitizer. 2025-11-05 11:09:30 -05:00
nodes Build whole-row Vars the same way during parsing and planning. 2025-03-12 11:47:19 -04:00
optimizer Fix computation of varnullingrels when translating appendrel Var 2026-02-20 18:04:26 +09:00
parser Fix possible incorrect column reference in ERROR message 2026-01-09 11:03:48 +13:00
partitioning Fix creation of partition descriptor during concurrent detach+drop 2024-08-12 18:17:56 -04:00
po Translation updates 2026-02-23 14:02:22 +01:00
port Don't treat EINVAL from semget() as a hard failure. 2025-08-13 11:59:47 -04:00
postmaster Fix snapshot handling bug in recent BRIN fix 2025-11-04 20:31:43 +01:00
regex Avoid assertion due to disconnected NFA sub-graphs in regex parsing. 2024-11-15 18:23:38 -05:00
replication Prevent invalidation of newly created replication slots. 2026-01-08 07:07:23 +00:00
rewrite Avoid rewriting data-modifying CTEs more than once. 2025-11-29 12:33:04 +00:00
snowball Avoid null pointer dereference crash after OOM in Snowball stemmers. 2025-02-18 21:23:59 -05:00
statistics Fix security checks in selectivity estimation functions. 2025-08-11 09:10:17 +01:00
storage Fix ProcWakeup() resetting wrong waitStart field. 2026-02-26 08:50:56 +09:00
tcop Check for CREATE privilege on the schema in CREATE STATISTICS. 2025-11-10 09:00:00 -06:00
tsearch Fix some cases of indirectly casting away const. 2026-02-25 11:19:50 -05:00
utils Fix some cases of indirectly casting away const. 2026-02-25 11:19:50 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Fix make headerscheck 2024-04-27 11:38:41 +07:00
meson.build Add win32ver data to meson-built postgres.exe. 2023-06-12 07:40:38 -07:00
nls.mk Add missing gettext triggers 2023-05-10 13:51:51 +02:00