From: Andres Freund <andres@anarazel.de>
To: Simon Riggs <simon@2ndquadrant.com>
To: pgsql-hackers@postgresql.org
Subject: Small locking bugs in hs
Date: Sun, 27 Dec 2009 20:12:32 +0100
Message-ID: <200912272012.32556.andres@anarazel.de> (raw)
Hi,
While unlikely to cause issues two new LWLockAcquire calls use the wrong
locking mode.
Patch attached.
Andres
Attachments:0001-Use-correct-locking-at-two-functions-used-by-Hot-Sta.patch (text/x-patch, 1.2K) download
From e70524baa7399972e51345d81b50377d7f15196d Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sun, 27 Dec 2009 17:28:39 +0100
Subject: [PATCH 1/2] Use correct locking at two functions used by Hot Standby - while not
likely to cause issues in reality its better to be correct.
---
src/backend/storage/ipc/procarray.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.cindex 85f14f6..8e2de35 100644--- a/src/backend/storage/ipc/procarray.c+++ b/src/backend/storage/ipc/procarray.c@@ -1648,7 +1648,7 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid,
errmsg("out of memory")));
}
- LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);+ LWLockAcquire(ProcArrayLock, LW_SHARED);
/*
* If we don't know the TransactionId that created the conflict, set
@@ -1710,7 +1710,7 @@ CancelVirtualTransaction(VirtualTransactionId vxid, int cancel_mode)
int index;
pid_t pid = 0;
- LWLockAcquire(ProcArrayLock, LW_SHARED);+ LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
for (index = 0; index < arrayP->numProcs; index++)
{
--
1.6.5.12.gd65df24
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: andres@anarazel.de, simon@2ndquadrant.com
Subject: Re: Small locking bugs in hs
In-Reply-To: <200912272012.32556.andres@anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox