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

Commit 3586931

Browse files
knizhnikkelvich
authored andcommitted
Fix problem with rollback of user 2pc transaction
1 parent 61d1396 commit 3586931

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

multimaster.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,10 +1359,14 @@ MtmAbortPreparedTransaction(MtmCurrentTrans* x)
13591359
tm = (MtmTransMap*)hash_search(MtmGid2State, x->gid, HASH_FIND, NULL);
13601360
if (tm == NULL) {
13611361
MTM_ELOG(WARNING, "Global transaction ID '%s' is not found", x->gid);
1362-
} else {
1363-
Assert(tm->state != NULL);
1362+
} else {
1363+
MtmTransState* ts = tm->state;
1364+
Assert(ts != NULL);
13641365
MTM_LOG1("Abort prepared transaction %s (%llu)", x->gid, (long64)x->xid);
1365-
MtmAbortTransaction(tm->state);
1366+
MtmAbortTransaction(ts);
1367+
if (ts->isTwoPhase) {
1368+
MtmDeactivateTransaction(ts);
1369+
}
13661370
}
13671371
MtmUnlock();
13681372
x->status = TRANSACTION_STATUS_ABORTED;

0 commit comments

Comments
 (0)