@@ -1063,7 +1063,7 @@ void MtmWakeUpBackend(MtmTransState* ts)
1063
1063
void MtmAbortTransaction (MtmTransState * ts )
1064
1064
{
1065
1065
if (ts -> status != TRANSACTION_STATUS_ABORTED ) {
1066
- MTM_LOG1 ("Rollback active transaction %d:%d" , ts -> gtid .node , ts -> gtid .xid );
1066
+ MTM_LOG1 ("Rollback active transaction %d:%d (local xid %d) " , ts -> gtid .node , ts -> gtid .xid , ts -> xid );
1067
1067
ts -> status = TRANSACTION_STATUS_ABORTED ;
1068
1068
MtmAdjustSubtransactions (ts );
1069
1069
Mtm -> nActiveTransactions -= 1 ;
@@ -1387,8 +1387,8 @@ bool MtmRefreshClusterStatus(bool nowait)
1387
1387
MtmAbortTransaction (ts );
1388
1388
MtmWakeUpBackend (ts );
1389
1389
}
1390
- } else if (BIT_CHECK (disabled , ts -> gtid .node - 1 )) { // coordinator of transaction is on disabled node
1391
- if (ts -> status != TRANSACTION_STATUS_ABORTED ) {
1390
+ } else if (TransactionIdIsValid ( ts -> gtid . xid ) && BIT_CHECK (disabled , ts -> gtid .node - 1 )) { // coordinator of transaction is on disabled node
1391
+ if (ts -> gid [ 0 ] && ts -> status != TRANSACTION_STATUS_ABORTED ) {
1392
1392
MtmAbortTransaction (ts );
1393
1393
FinishPreparedTransaction (ts -> gid , false);
1394
1394
}
@@ -1457,8 +1457,8 @@ void MtmOnNodeDisconnect(int nodeId)
1457
1457
MtmAbortTransaction (ts );
1458
1458
MtmWakeUpBackend (ts );
1459
1459
}
1460
- } else if (ts -> gtid .node == nodeId ) { //coordinator of transaction is on disabled node
1461
- if (ts -> status != TRANSACTION_STATUS_ABORTED ) {
1460
+ } else if (TransactionIdIsValid ( ts -> gtid . xid ) && ts -> gtid .node == nodeId ) { //coordinator of transaction is on disabled node
1461
+ if (ts -> gid [ 0 ] && ts -> status != TRANSACTION_STATUS_ABORTED ) {
1462
1462
MtmAbortTransaction (ts );
1463
1463
FinishPreparedTransaction (ts -> gid , false);
1464
1464
}
0 commit comments