Content-Length: 278139 | pFad | http://github.com/postgrespro/postgres_cluster/commit/7b14ccc6ed6847638fdc4a799998c571875ce441

36 Fix release of LWlocks in case of errors · postgrespro/postgres_cluster@7b14ccc · GitHub
Skip to content

Commit 7b14ccc

Browse files
knizhnikkelvich
authored andcommitted
Fix release of LWlocks in case of errors
1 parent d80b432 commit 7b14ccc

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

multimaster.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,6 @@ void MtmReleaseLocks(void)
291291
if (MtmClusterLocked) {
292292
MtmUnlockCluster();
293293
}
294-
if (MtmLockCount != 0) {
295-
Assert(Mtm->lastLockHolder == MyProcPid);
296-
MtmLockCount = 0;
297-
Mtm->lastLockHolder = 0;
298-
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
299-
}
300-
301294
}
302295

303296
/*
@@ -1808,6 +1801,7 @@ void MtmAbortTransaction(MtmTransState* ts)
18081801
void MtmHandleApplyError(void)
18091802
{
18101803
ErrorData *edata = CopyErrorData();
1804+
MtmLockCount = 0; /* LWLocks will be released by AbortTransaction, we just need to clear owr MtmLockCount */
18111805
switch (edata->sqlerrcode) {
18121806
case ERRCODE_DISK_FULL:
18131807
case ERRCODE_INSUFFICIENT_RESOURCES:

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_cluster/commit/7b14ccc6ed6847638fdc4a799998c571875ce441

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy