v1-0001-Fix-bug-of-clearing-of-waitStart-in-ProcWakeup.patch

application/octet-stream

Filename: v1-0001-Fix-bug-of-clearing-of-waitStart-in-ProcWakeup.patch
Type: application/octet-stream
Part: 0
Message: Re: Fix bug of clearing of waitStart in ProcWakeup()

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v1-0001
Subject: Fix bug of clearing of waitStart in ProcWakeup()
File+
src/backend/storage/lmgr/proc.c 1 1
From 5a741a41f675a8cff11cdbb20c819e4853ed1499 Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Tue, 24 Feb 2026 14:11:24 +0800
Subject: [PATCH v1] Fix bug of clearing of waitStart in ProcWakeup()

ProcWakeup() incorrectly resets MyProc->waitStart instead of the
waitStart field of the process being awakened.

Fix by resetting proc->waitStart, which corresponds to the PGPROC
being removed from the wait queue.

This looks like oversight of 46d6e5f.

Author: Chao Li <lic@highgo.com>
Reviewed-by:
Discussion: https://postgr.es/m/
---
 src/backend/storage/lmgr/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index e2f34075d39..771b006b522 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -1715,7 +1715,7 @@ ProcWakeup(PGPROC *proc, ProcWaitStatus waitStatus)
 	proc->waitLock = NULL;
 	proc->waitProcLock = NULL;
 	proc->waitStatus = waitStatus;
-	pg_atomic_write_u64(&MyProc->waitStart, 0);
+	pg_atomic_write_u64(&proc->waitStart, 0);
 
 	/* And awaken it */
 	SetLatch(&proc->procLatch);
-- 
2.50.1 (Apple Git-155)