Skip to content

Commit 883d363

Browse files
committed
Reset latch
1 parent 3a8bfdd commit 883d363

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contrib/mmts/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);

contrib/mmts/multimaster.c

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

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