@@ -1020,9 +1020,19 @@ Mtm2PCVoting(MtmCurrentTrans* x, MtmTransState* ts)
1020
1020
timestamp_t start = MtmGetSystemTime ();
1021
1021
timestamp_t deadline = start + timeout ;
1022
1022
timestamp_t now ;
1023
-
1023
+ nodemask_t liveNodesMask = (((nodemask_t )1 << Mtm -> nAllNodes ) - 1 ) & ~Mtm -> disabledNodeMask & ~((nodemask_t )1 << (MtmNodeId - 1 ));
1024
+
1024
1025
Assert (ts -> csn > ts -> snapshot );
1025
1026
1027
+ if (ts -> participantsMask != liveNodesMask )
1028
+ {
1029
+ elog (WARNING , "Abort transaction %d (%s) because cluster configuration is changed from %lx to %lx since transaction start" ,
1030
+ ts -> xid , ts -> gid , ts -> participantsMask , liveNodesMask );
1031
+ MtmAbortTransaction (ts );
1032
+ x -> status = TRANSACTION_STATUS_ABORTED ;
1033
+ return ;
1034
+ }
1035
+
1026
1036
/* Wait votes from all nodes until: */
1027
1037
while (!MtmVotingCompleted (ts )
1028
1038
&& (ts -> isPrepared || nConfigChanges == Mtm -> nConfigChanges ))
@@ -1534,11 +1544,13 @@ XidStatus MtmExchangeGlobalTransactionStatus(char const* gid, XidStatus new_stat
1534
1544
}
1535
1545
if (tm -> state != NULL && old_status == TRANSACTION_STATUS_IN_PROGRESS ) {
1536
1546
/* Return UNKNOWN to mark that transaction was prepared */
1537
- MTM_LOG1 ("Change status of in-progress transaction %s to %s" , gid , MtmTxtStatusMnem [new_status ]);
1547
+ if (new_status != TRANSACTION_STATUS_UNKNOWN ) {
1548
+ MTM_LOG1 ("Change status of in-progress transaction %s to %s" , gid , MtmTxnStatusMnem [new_status ]);
1549
+ }
1538
1550
old_status = TRANSACTION_STATUS_UNKNOWN ;
1539
1551
}
1540
1552
} else {
1541
- MTM_LOG1 ("Set status of unknown transaction %s to %s" , gid , MtmTxtStatusMnem [new_status ]);
1553
+ MTM_LOG2 ("Set status of unknown transaction %s to %s" , gid , MtmTxnStatusMnem [new_status ]);
1542
1554
tm -> state = NULL ;
1543
1555
tm -> status = new_status ;
1544
1556
}
0 commit comments