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

Commit 67d86d6

Browse files
knizhnikkelvich
authored andcommitted
Fix commit of local transactions
1 parent e6d6f56 commit 67d86d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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);
@@ -1385,6 +1385,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
13851385
if (!ts->isLocal) {
13861386
Mtm2PCVoting(x, ts);
13871387
} else {
1388+
ts->status = TRANSACTION_STATUS_UNKNOWN;
13881389
ts->votingCompleted = true;
13891390
}
13901391
if (x->isTwoPhase) {
@@ -2369,8 +2370,8 @@ static void MtmInitialize()
23692370
Mtm->oldestXid = FirstNormalTransactionId;
23702371
Mtm->nLiveNodes = 0; //MtmNodes;
23712372
Mtm->nAllNodes = MtmNodes;
2372-
Mtm->disabledNodeMask = 7; //XXXX
2373-
Mtm->clique = 7; // XXXX ! should be inverted !
2373+
Mtm->disabledNodeMask = (((nodemask_t)1 << MtmNodes) - 1);
2374+
Mtm->clique = 0;
23742375
Mtm->stalledNodeMask = 0;
23752376
Mtm->stoppedNodeMask = 0;
23762377
Mtm->deadNodeMask = 0;

0 commit comments

Comments
 (0)