public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Fix ProcWakeup() resetting wrong waitStart field.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix ProcWakeup() resetting wrong waitStart field.
@ 2026-02-25 23:51  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-02-25 23:51 UTC (permalink / raw)
  To: [email protected]

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix ProcWakeup() resetting wrong waitStart field.
@ 2026-02-25 23:51  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-02-25 23:51 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0d3be050178466970644caaaa4d79848a1fcd630

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix ProcWakeup() resetting wrong waitStart field.
@ 2026-02-25 23:52  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-02-25 23:52 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f72c92a7f9456b6c490b37e7c81d6a4b49307262

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix ProcWakeup() resetting wrong waitStart field.
@ 2026-02-25 23:52  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-02-25 23:52 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b993706787d0165136bdc183443982f053e5044b

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix ProcWakeup() resetting wrong waitStart field.
@ 2026-02-25 23:52  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-02-25 23:52 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/74ee3e9e73656497d0bbf57ff6d839b37feefb09

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix ProcWakeup() resetting wrong waitStart field.
@ 2026-02-25 23:52  Fujii Masao <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-02-25 23:52 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d2dec77efaf98049b24efd716f5cc677405a9e2

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-02-25 23:52 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 23:51 pgsql: Fix ProcWakeup() resetting wrong waitStart field. Fujii Masao <[email protected]>
2026-02-25 23:51 pgsql: Fix ProcWakeup() resetting wrong waitStart field. Fujii Masao <[email protected]>
2026-02-25 23:52 pgsql: Fix ProcWakeup() resetting wrong waitStart field. Fujii Masao <[email protected]>
2026-02-25 23:52 pgsql: Fix ProcWakeup() resetting wrong waitStart field. Fujii Masao <[email protected]>
2026-02-25 23:52 pgsql: Fix ProcWakeup() resetting wrong waitStart field. Fujii Masao <[email protected]>
2026-02-25 23:52 pgsql: Fix ProcWakeup() resetting wrong waitStart field. Fujii Masao <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox