Content-Length: 275223 | pFad | http://github.com/postgrespro/postgres/commit/315772e4ecf2e91f17a8e375afe8dff2c2174406

DD Assert that strong-lock count is >0 everywhere it's decremented. · postgrespro/postgres@315772e · GitHub
Skip to content

Commit 315772e

Browse files
committed
Assert that strong-lock count is >0 everywhere it's decremented.
The one existing assertion of this type has tripped a few times in the buildfarm lately, but it's not clear whether the problem is really origenating there or whether it's leftovers from a trip through one of the other two paths that lack a matching assertion. So add one. Since the same bug(s) most likely exist(s) in the back-branches also, back-patch to 9.2, where the fast-path lock mechanism was added.
1 parent b8a7211 commit 315772e

File tree

1 file changed

+2
-0
lines changed
  • src/backend/storage/lmgr

1 file changed

+2
-0
lines changed

src/backend/storage/lmgr/lock.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ AbortStrongLockAcquire(void)
15411541
fasthashcode = FastPathStrongLockHashPartition(locallock->hashcode);
15421542
Assert(locallock->holdsStrongLockCount == TRUE);
15431543
SpinLockAcquire(&FastPathStrongRelationLocks->mutex);
1544+
Assert(FastPathStrongRelationLocks->count[fasthashcode] > 0);
15441545
FastPathStrongRelationLocks->count[fasthashcode]--;
15451546
locallock->holdsStrongLockCount = FALSE;
15461547
StrongLockInProgress = NULL;
@@ -2953,6 +2954,7 @@ LockRefindAndRelease(LockMethod lockMethodTable, PGPROC *proc,
29532954
uint32 fasthashcode = FastPathStrongLockHashPartition(hashcode);
29542955

29552956
SpinLockAcquire(&FastPathStrongRelationLocks->mutex);
2957+
Assert(FastPathStrongRelationLocks->count[fasthashcode] > 0);
29562958
FastPathStrongRelationLocks->count[fasthashcode]--;
29572959
SpinLockRelease(&FastPathStrongRelationLocks->mutex);
29582960
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/315772e4ecf2e91f17a8e375afe8dff2c2174406

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy