Skip to content

Commit b982c3b

Browse files
committed
Add missing SpinRelease() to a couple of error exits --- bug found while
testing concurrent VACUUMs.
1 parent 4dded12 commit b982c3b

File tree

1 file changed

+3
-6
lines changed
  • src/backend/storage/lmgr

1 file changed

+3
-6
lines changed

src/backend/storage/lmgr/lock.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.62 1999/09/18 19:07:38 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.63 1999/11/28 01:56:48 tgl Exp $
1111
*
1212
* NOTES
1313
* Outside modules can create a lock table and acquire/release
@@ -595,6 +595,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, LOCKMODE lockmode)
595595
HASH_ENTER, &found);
596596
if (!result)
597597
{
598+
SpinRelease(masterLock);
598599
elog(NOTICE, "LockAcquire: xid table corrupted");
599600
return FALSE;
600601
}
@@ -738,6 +739,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, LOCKMODE lockmode)
738739
XID_PRINT_AUX("LockAcquire: INCONSISTENT ", result);
739740
LOCK_PRINT_AUX("LockAcquire: INCONSISTENT ", lock, lockmode);
740741
/* Should we retry ? */
742+
SpinRelease(masterLock);
741743
return FALSE;
742744
}
743745
XID_PRINT("LockAcquire: granted", result);
@@ -2000,8 +2002,6 @@ DumpLocks()
20002002
XIDLookupEnt *xidLook = NULL;
20012003
XIDLookupEnt *tmp = NULL;
20022004
SHMEM_OFFSET end;
2003-
SPINLOCK masterLock;
2004-
int numLockModes;
20052005
LOCK *lock;
20062006
int count = 0;
20072007
int lockmethod = DEFAULT_LOCKMETHOD;
@@ -2020,9 +2020,6 @@ DumpLocks()
20202020
if (!lockMethodTable)
20212021
return;
20222022

2023-
numLockModes = lockMethodTable->ctl->numLockModes;
2024-
masterLock = lockMethodTable->ctl->masterLock;
2025-
20262023
if (SHMQueueEmpty(lockQueue))
20272024
return;
20282025

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy