aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/multixact.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-11-14 15:14:01 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-11-14 15:14:01 -0300
commit51f9ea25dc4296948eb851a851bb60e0860c70a1 (patch)
tree0935090db8b5313aa6bc976fce10920ed3ec6a6d /src/backend/access/transam/multixact.c
parent0c5af0a537a2d6320eb8ef7f401401aa1f47b79e (diff)
downloadpostgresql-51f9ea25dc4296948eb851a851bb60e0860c70a1.tar.gz
postgresql-51f9ea25dc4296948eb851a851bb60e0860c70a1.zip
Allow interrupting GetMultiXactIdMembers
This function has a loop which can lead to uninterruptible process "stalls" (actually infinite loops) when some bugs are triggered. Avoid that unpleasant situation by adding a check for interrupts in a place that shouldn't degrade performance in the normal case. Backpatch to 9.3. Older branches have an identical loop here, but the aforementioned bugs are only a problem starting in 9.3 so there doesn't seem to be any point in backpatching any further.
Diffstat (limited to 'src/backend/access/transam/multixact.c')
-rw-r--r--src/backend/access/transam/multixact.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index bfbe738530e..3c20bb37e4c 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1278,6 +1278,7 @@ retry:
{
/* Corner case 2: next multixact is still being filled in */
LWLockRelease(MultiXactOffsetControlLock);
+ CHECK_FOR_INTERRUPTS();
pg_usleep(1000L);
goto retry;
}