Skip to content

Commit 9b1ae2b

Browse files
knizhnikkelvich
authored andcommitted
Reset latch
1 parent 02789a0 commit 9b1ae2b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arbiter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,9 @@ static void MtmTransReceiver(Datum arg)
776776
}
777777
break;
778778
case MSG_PREPARED:
779+
Assert(ts->nVotes < Mtm->nLiveNodes);
779780
if (ts->status != TRANSACTION_STATUS_ABORTED) {
780781
Assert(ts->status == TRANSACTION_STATUS_IN_PROGRESS);
781-
Assert(ts->nVotes < Mtm->nLiveNodes);
782782
if (msg->csn > ts->csn) {
783783
ts->csn = msg->csn;
784784
MtmSyncClock(ts->csn);

multimaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,13 +803,13 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
803803
MtmUnlock();
804804
MtmWatchdog();
805805
result = WaitLatch(&MyProc->procLatch, WL_LATCH_SET|WL_TIMEOUT, timeout);
806-
if (result & WL_TIMEOUT) {
806+
if (result & WL_LATCH_SET) {
807+
ResetLatch(&MyProc->procLatch);
808+
} else if (result & WL_TIMEOUT) {
807809
if (MtmGetSystemTime() > deadline) {
808810
MtmLock(LW_SHARED);
809811
break;
810812
}
811-
} else {
812-
ResetLatch(&MyProc->procLatch);
813813
}
814814
MtmLock(LW_SHARED);
815815
}

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