Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 69e0d04

Browse files
committed
Fix commit of local transactions
1 parent 180229d commit 69e0d04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contrib/mmts/multimaster.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,12 +1128,12 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
11281128
/*
11291129
* Invalid CSN prevent replication of transaction by logical replication
11301130
*/
1131-
ts->isLocal = x->isReplicated || !x->containsDML;
11321131
ts->snapshot = x->snapshot;
11331132
ts->csn = MtmAssignCSN();
11341133
ts->procno = MyProc->pgprocno;
11351134
ts->votingCompleted = false;
11361135
ts->participantsMask = (((nodemask_t)1 << Mtm->nAllNodes) - 1) & ~Mtm->disabledNodeMask & ~((nodemask_t)1 << (MtmNodeId-1));
1136+
ts->isLocal = x->isReplicated || !x->containsDML || (ts->participantsMask == 0);
11371137
ts->nConfigChanges = Mtm->nConfigChanges;
11381138
ts->votedMask = 0;
11391139
ts->nSubxids = xactGetCommittedChildren(&subxids);
@@ -1384,6 +1384,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
13841384
if (!ts->isLocal) {
13851385
Mtm2PCVoting(x, ts);
13861386
} else {
1387+
ts->status = TRANSACTION_STATUS_UNKNOWN;
13871388
ts->votingCompleted = true;
13881389
}
13891390
if (x->isTwoPhase) {
@@ -2373,8 +2374,8 @@ static void MtmInitialize()
23732374
Mtm->oldestXid = FirstNormalTransactionId;
23742375
Mtm->nLiveNodes = 0; //MtmNodes;
23752376
Mtm->nAllNodes = MtmNodes;
2376-
Mtm->disabledNodeMask = 7; //XXXX
2377-
Mtm->clique = 7; // XXXX ! should be inverted !
2377+
Mtm->disabledNodeMask = (((nodemask_t)1 << MtmNodes) - 1);
2378+
Mtm->clique = 0;
23782379
Mtm->stalledNodeMask = 0;
23792380
Mtm->stoppedNodeMask = 0;
23802381
Mtm->deadNodeMask = 0;

0 commit comments

Comments
 (0)