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

Commit ab68613

Browse files
committed
Fix problem with rollback of user 2pc transaction
1 parent 60bf0b3 commit ab68613

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contrib/mmts/multimaster.c

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

0 commit comments

Comments
 (0)