@@ -1064,7 +1064,7 @@ void MtmWakeUpBackend(MtmTransState* ts)
1064
1064
void MtmAbortTransaction (MtmTransState * ts )
1065
1065
{
1066
1066
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 );
1068
1068
ts -> status = TRANSACTION_STATUS_ABORTED ;
1069
1069
MtmAdjustSubtransactions (ts );
1070
1070
Mtm -> nActiveTransactions -= 1 ;
@@ -1388,9 +1388,8 @@ bool MtmRefreshClusterStatus(bool nowait)
1388
1388
MtmAbortTransaction (ts );
1389
1389
MtmWakeUpBackend (ts );
1390
1390
}
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 ) {
1394
1393
MtmAbortTransaction (ts );
1395
1394
FinishPreparedTransaction (ts -> gid , false);
1396
1395
}
@@ -1459,9 +1458,8 @@ void MtmOnNodeDisconnect(int nodeId)
1459
1458
MtmAbortTransaction (ts );
1460
1459
MtmWakeUpBackend (ts );
1461
1460
}
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 ) {
1465
1463
MtmAbortTransaction (ts );
1466
1464
FinishPreparedTransaction (ts -> gid , false);
1467
1465
}
0 commit comments