Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vuluh-005eXA-2z for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Feb 2026 06:28:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vulug-00HNkD-2q for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Feb 2026 06:28:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vulug-00HNk5-1X for pgsql-hackers@lists.postgresql.org; Tue, 24 Feb 2026 06:28:54 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vuluc-00000000uz3-1OpQ for pgsql-hackers@lists.postgresql.org; Tue, 24 Feb 2026 06:28:53 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-824484dba4dso3650970b3a.0 for ; Mon, 23 Feb 2026 22:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771914530; x=1772519330; darn=lists.postgresql.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=nz7lsSb/yvkjUtjRt94VKkdbSCiZNmGUfIPnqc37I+w=; b=XDU0UrnU77uSdXFoPiLbYf0X1Qa0X2ICIn4sghhosOiisabHSmw3y/udGPv/iRBAmf Rqdt7uw79Jh6ozfGQvEMLWfg9Uh/sh77it53C4LlXfpWTMYD0gPou64a5MCj+EASpbkY FejPHRyLm8xh+eXwvmPgPgdZwTyWn5pPGr6nzY7EYTemw99IKfvOlwL7n87Z3loWs9lo hcXTVGKlizmjvV70A1b3RZ2633zkuf9nZqCQo4NmQf93kut7STx5MavD1wVvEkwdY/oT q2N+k3c3VYND2u8wqfRT8g4qUQwkZW8Q09EwZdMaMHrm6SD4SCTosPn/Q28XRGZXyDdA Jolg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771914530; x=1772519330; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nz7lsSb/yvkjUtjRt94VKkdbSCiZNmGUfIPnqc37I+w=; b=V96DqAEiiOpVC1XyYxCCVvRvMO8D2LlHn6a5ValoDMb5gEoladuiMC/TJ2try39k4Y 5XXaOsYCr/CGt2oUNVp8PfACFt1fXOVcublK1eMixUUiMAyQ/M5xExmQSk6s6Y5GuJHG tKlwW876NJaWRFyfs62c8rX1O5JuUzotPUgTMzuxQ98iL9OXA8gko8Mi4mWNoXjKk8U1 5sjhSiBCt/4vCDuVy2gN70tkoavgOLgVeS3RmsnSXYEeb2qhOn4AmVz3B+i9gkE9VpLV iQwgElFSRmMLGtk8+h2EXd2m7EC9B4AncdjxrLRuQJtCetWtX0FSGVNdvtzuu/IoQUL1 QUsg== X-Gm-Message-State: AOJu0YwToV+yupZdNFU5Ds3ZG+/ZKIHQU/uaBHk1CQcQBTS7x3qsQ5dZ m8xzVe1MN74oRbdnakwVgDh0zB0oZglsBoV4nTQEKR0K/y5cAbLVgx1/yu7yzw== X-Gm-Gg: ATEYQzxXDEbWmq3eHn0ONYiYeNh3xG7pWRti8Btk1qc9WSe2JlIpIVft6SD4wnf7mYE WyzdqJ/OMd+o2O9L2WnbCo9+Q05yekgXj71aKLsR5SI6oOHEQuee5QqTIPhdeVt/ou4eFcTFmsc HzdFP5cjdCHaZaxaPPJbssF22HBkifIIgUfTJqbYyMWdXKkaFUtXoloiSwn3pNuCPSLKXOrXr6p qDYjtsi15qXiAQ3gg8VWcM6bXU6BZJ8Yts/RMME0aoz86o3qyV+7EAL9f+cjppMTV1BaI62gFuX YrqIeH9w9mYU/LzviG5nZ11po2pczeQ4uc5APUe3snxWItYaJDfydyTGGkK+i6T7F+lY+wOTHx+ 130+qarZ1huxS6g1577XlCPNU7TSKqvcsJr4j8V4C2a8qYcB0u6eIfh5gLcXVj6hTHA0S8EYbTY M6mgctH9SKzS1krNs5LrUOXhWIsulG2qykqS3D7TpZ X-Received: by 2002:a05:6a00:2e16:b0:7ef:d070:df1e with SMTP id d2e1a72fcca58-826da8bde47mr10515951b3a.3.1771914530173; Mon, 23 Feb 2026 22:28:50 -0800 (PST) Received: from smtpclient.apple ([203.10.98.27]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-826dd641313sm9300417b3a.1.2026.02.23.22.28.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2026 22:28:49 -0800 (PST) From: Chao Li Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.300.41.1.7\)) Subject: Fix bug of clearing of waitStart in ProcWakeup() Message-Id: <537BD852-EC61-4D25-AB55-BE8BE46D07D7@gmail.com> Date: Tue, 24 Feb 2026 14:28:15 +0800 To: PostgreSQL Hackers X-Mailer: Apple Mail (2.3864.300.41.1.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I just noticed this while reviewing patch [1]. It looks like this is = caused by a simple typo. In ProcWakeup(): ``` PGPROC * ProcWakeup(PGPROC *proc, ProcWaitStatus waitStatus) { PGPROC *retProc; /* Proc should be sleeping ... */ if (proc->links.prev =3D=3D NULL || proc->links.next =3D=3D NULL) return NULL; Assert(proc->waitStatus =3D=3D PROC_WAIT_STATUS_WAITING); /* Save next process before we zap the list link */ retProc =3D (PGPROC *) proc->links.next; /* Remove process from wait queue */ SHMQueueDelete(&(proc->links)); (proc->waitLock->waitProcs.size)--; /* Clean up process' state and pass it the ok/fail signal */ proc->waitLock =3D NULL; proc->waitProcLock =3D NULL; proc->waitStatus =3D waitStatus; pg_atomic_write_u64(&MyProc->waitStart, 0); <=3D=3D Here, it = should operate on proc /* And awaken it */ SetLatch(&proc->procLatch); return retProc; } ``` Since this function is clearly operating on the parameter proc, the only = statement that touches MyProc looks suspicious. It should reset = proc->waitStart, not MyProc->waitStart. As written, it will incorrectly clear the caller=E2=80=99s waitStart = instead of the awakened backend=E2=80=99s, potentially leaving a stale = waitStart value in the target PGPROC. [1] = https://postgr.es/m/CAHGQGwGw4LhNwOGQT3nbw3uWy8gL94_MB4T39Wfr4_Vgopuovg@ma= il.gmail.com Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/