0002-Fix-comment-in-LockReleaseAll-on-when-locallock-nLoc.patch
text/x-patch
Filename: 0002-Fix-comment-in-LockReleaseAll-on-when-locallock-nLoc.patch
Type: text/x-patch
Part: 1
Message:
Re: Latches vs lwlock contention
Patch
Format: format-patch
Series: patch 0002
Subject: Fix comment in LockReleaseAll() on when locallock->nLock can be zero
| File | + | − |
|---|---|---|
| src/backend/storage/lmgr/lock.c | 2 | 3 |
From 22bc7a3b7826dfbb991b5d63ad1fba52bb297923 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Mon, 22 Jul 2024 00:43:13 +0300
Subject: [PATCH 2/8] Fix comment in LockReleaseAll() on when locallock->nLock
can be zero
We reach this case also e.g. when a deadlock is detected, not only
when we run out of memory.
---
src/backend/storage/lmgr/lock.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 05b3a243b5c..7eb5c2e5226 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -2208,9 +2208,8 @@ LockReleaseAll(LOCKMETHODID lockmethodid, bool allLocks)
while ((locallock = (LOCALLOCK *) hash_seq_search(&status)) != NULL)
{
/*
- * If the LOCALLOCK entry is unused, we must've run out of shared
- * memory while trying to set up this lock. Just forget the local
- * entry.
+ * If the LOCALLOCK entry is unused, something must've gone wrong
+ * while trying to acquire this lock. Just forget the local entry.
*/
if (locallock->nLocks == 0)
{
--
2.39.2