@@ -2018,7 +2018,8 @@ void MtmPollStatusOfPreparedTransactionsForDisabledNode(int disabledNodeId, bool
2018
2018
* This function is called before start of recovery to prevent blocking of recovery process by some
2019
2019
* prepared transaction which is not recovered
2020
2020
*/
2021
- static void MtmPollStatusOfPreparedTransactions ()
2021
+ void
2022
+ MtmPollStatusOfPreparedTransactions (bool majorMode )
2022
2023
{
2023
2024
MtmTransState * ts ;
2024
2025
for (ts = Mtm -> transListHead ; ts != NULL ; ts = ts -> next ) {
@@ -2027,8 +2028,16 @@ static void MtmPollStatusOfPreparedTransactions()
2027
2028
&& (ts -> status == TRANSACTION_STATUS_UNKNOWN || ts -> status == TRANSACTION_STATUS_IN_PROGRESS ))
2028
2029
{
2029
2030
Assert (ts -> gid [0 ]);
2030
- MTM_LOG1 ("Poll state of transaction %s (%llu) from node %d" , ts -> gid , (long64 )ts -> xid , ts -> gtid .node );
2031
- MtmBroadcastPollMessage (ts );
2031
+
2032
+ if (majorMode )
2033
+ {
2034
+ MtmFinishPreparedTransaction (ts , ts -> status != TRANSACTION_STATUS_IN_PROGRESS );
2035
+ }
2036
+ else
2037
+ {
2038
+ MTM_LOG1 ("Poll state of transaction %s (%llu) from node %d" , ts -> gid , (long64 )ts -> xid , ts -> gtid .node );
2039
+ MtmBroadcastPollMessage (ts );
2040
+ }
2032
2041
} else {
2033
2042
MTM_LOG2 ("Skip prepared transaction %s (%d) with status %s gtid.node=%d gtid.xid=%llu votedMask=%llx" ,
2034
2043
ts -> gid , (long64 )ts -> xid , MtmTxnStatusMnem [ts -> status ], ts -> gtid .node , (long64 )ts -> gtid .xid , ts -> votedMask );
@@ -3420,7 +3429,7 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId, sig_atomic_t volatile* shut
3420
3429
{
3421
3430
/* Lock on us */
3422
3431
Mtm -> recoverySlot = nodeId ;
3423
- MtmPollStatusOfPreparedTransactions ();
3432
+ MtmPollStatusOfPreparedTransactions (false );
3424
3433
MtmUnlock ();
3425
3434
return REPLMODE_RECOVERY ;
3426
3435
}
0 commit comments