From 6d234c43d5fae8c08e4e8374e86d58c3fa21faad Mon Sep 17 00:00:00 2001 From: alterego655 <824662526@qq.com> Date: Fri, 24 Jul 2026 16:37:20 +0800 Subject: [PATCH v1 4/5] Clarify LSN waiter cleanup after wakeup WaitLSNWakeup() can be called by several processes, not only the startup process. Update the cleanup comment to explain that another process may remove the waiter before waking it and that inHeap prevents double deletion. --- src/backend/access/transam/xlogwait.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/access/transam/xlogwait.c b/src/backend/access/transam/xlogwait.c index fd6599b4274..f60491b67d1 100644 --- a/src/backend/access/transam/xlogwait.c +++ b/src/backend/access/transam/xlogwait.c @@ -515,9 +515,9 @@ WaitForLSN(WaitLSNType lsnType, XLogRecPtr targetLSN, int64 timeout) } /* - * Delete our process from the shared memory heap. We might already be - * deleted by the startup process. The 'inHeap' flags prevents us from - * the double deletion. + * Remove our entry from the shared waiters heap. Another process may + * already have removed it before waking us through WaitLSNWakeup(), so + * the inHeap flag prevents double deletion. */ deleteLSNWaiter(lsnType); -- 2.51.0