@@ -1064,7 +1064,7 @@ void MtmWakeUpBackend(MtmTransState* ts)
10641064void MtmAbortTransaction (MtmTransState * ts )
10651065{
10661066 if (ts -> status != TRANSACTION_STATUS_ABORTED ) {
1067- MTM_LOG1 ("Rollback active transaction %d:%d" , ts -> gtid .node , ts -> gtid .xid );
1067+ MTM_LOG1 ("Rollback active transaction %d:%d (local xid %d) " , ts -> gtid .node , ts -> gtid .xid , ts -> xid );
10681068 ts -> status = TRANSACTION_STATUS_ABORTED ;
10691069 MtmAdjustSubtransactions (ts );
10701070 Mtm -> nActiveTransactions -= 1 ;
@@ -1388,9 +1388,8 @@ bool MtmRefreshClusterStatus(bool nowait)
13881388 MtmAbortTransaction (ts );
13891389 MtmWakeUpBackend (ts );
13901390 }
1391- } else if (BIT_CHECK (disabled , ts -> gtid .node - 1 )) { // coordinator of transaction is on disabled node
1392- if (ts -> status != TRANSACTION_STATUS_ABORTED ) {
1393- MTM_LOG1 ("1) Rollback active transaction %d:%d:%d" , ts -> gtid .node , ts -> gtid .xid , ts -> xid );
1391+ } else if (TransactionIdIsValid (ts -> gtid .xid ) && BIT_CHECK (disabled , ts -> gtid .node - 1 )) { // coordinator of transaction is on disabled node
1392+ if (ts -> gid [0 ] && ts -> status != TRANSACTION_STATUS_ABORTED ) {
13941393 MtmAbortTransaction (ts );
13951394 FinishPreparedTransaction (ts -> gid , false);
13961395 }
@@ -1459,9 +1458,8 @@ void MtmOnNodeDisconnect(int nodeId)
14591458 MtmAbortTransaction (ts );
14601459 MtmWakeUpBackend (ts );
14611460 }
1462- } else if (ts -> gtid .node == nodeId ) { //coordinator of transaction is on disabled node
1463- if (ts -> status != TRANSACTION_STATUS_ABORTED ) {
1464- MTM_LOG1 ("2) Rollback active transaction %d:%d" , ts -> gtid .node , ts -> gtid .xid );
1461+ } else if (TransactionIdIsValid (ts -> gtid .xid ) && ts -> gtid .node == nodeId ) { //coordinator of transaction is on disabled node
1462+ if (ts -> gid [0 ] && ts -> status != TRANSACTION_STATUS_ABORTED ) {
14651463 MtmAbortTransaction (ts );
14661464 FinishPreparedTransaction (ts -> gid , false);
14671465 }
0 commit comments