@@ -898,14 +898,13 @@ static void MtmReceiver(Datum arg)
898
898
msg -> status = TRANSACTION_STATUS_ABORTED ;
899
899
} else {
900
900
msg -> status = tm -> state -> status ;
901
- msg -> csn = tm -> state -> csn ;
901
+ msg -> csn = tm -> state -> csn ;
902
902
MTM_LOG1 ("Send response %d for transaction %s to node %d" , msg -> status , msg -> gid , msg -> node );
903
903
}
904
904
msg -> disabledNodeMask = Mtm -> disabledNodeMask ;
905
905
msg -> connectivityMask = Mtm -> connectivityMask ;
906
906
msg -> oldestSnapshot = Mtm -> nodes [MtmNodeId - 1 ].oldestSnapshot ;
907
907
msg -> code = MSG_POLL_STATUS ;
908
- msg -> csn = ts -> csn ;
909
908
MtmSendMessage (msg );
910
909
continue ;
911
910
case MSG_POLL_STATUS :
@@ -918,11 +917,11 @@ static void MtmReceiver(Datum arg)
918
917
BIT_SET (ts -> votedMask , node - 1 );
919
918
if (ts -> status == TRANSACTION_STATUS_UNKNOWN ) {
920
919
if (msg -> status == TRANSACTION_STATUS_IN_PROGRESS || msg -> status == TRANSACTION_STATUS_ABORTED ) {
921
- elog (LOG , "Abort transaction %s because it is in state %d at node %d" ,
922
- msg -> gid , ts -> status , node );
920
+ elog (LOG , "Abort prepared transaction %s because it is in state %s at node %d" ,
921
+ msg -> gid , MtmNodeStatusMnem [ msg -> status ] , node );
923
922
MtmFinishPreparedTransaction (ts , false);
924
923
}
925
- else if (msg -> status == TRANSACTION_STATUS_COMMITTED || msg -> status == TRANSACTION_STATUS_UNKNOWN )
924
+ else if (msg -> status == TRANSACTION_STATUS_COMMITTED || msg -> status == TRANSACTION_STATUS_UNKNOWN )
926
925
{
927
926
if (msg -> csn > ts -> csn ) {
928
927
ts -> csn = msg -> csn ;
@@ -933,17 +932,17 @@ static void MtmReceiver(Datum arg)
933
932
MtmFinishPreparedTransaction (ts , true);
934
933
}
935
934
} else {
936
- elog (LOG , "Receive response %d for transaction %s for node %d, votedMask= %llx, participantsMask= %llx" ,
937
- msg -> status , msg -> gid , node , (long long ) ts -> votedMask , (long long ) (ts -> participantsMask & ~Mtm -> disabledNodeMask ));
935
+ elog (LOG , "Receive response %s for transaction %s for node %d, votedMask %llx, participantsMask %llx" ,
936
+ MtmNodeStatusMnem [ msg -> status ] , msg -> gid , node , (long long )ts -> votedMask , (long long )(ts -> participantsMask & ~Mtm -> disabledNodeMask ));
938
937
continue ;
939
938
}
940
939
} else if (ts -> status == TRANSACTION_STATUS_ABORTED && msg -> status == TRANSACTION_STATUS_COMMITTED ) {
941
940
elog (WARNING , "Transaction %s is aborted at node %d but committed at node %d" , msg -> gid , MtmNodeId , node );
942
941
} else if (msg -> status == TRANSACTION_STATUS_ABORTED && ts -> status == TRANSACTION_STATUS_COMMITTED ) {
943
942
elog (WARNING , "Transaction %s is committed at node %d but aborted at node %d" , msg -> gid , MtmNodeId , node );
944
943
} else {
945
- elog (LOG , "Receive response %d for transaction %s status %d for node %d, votedMask= %llx, participantsMask= %llx" ,
946
- msg -> status , msg -> gid , ts -> status , node , (long long ) ts -> votedMask , (long long ) (ts -> participantsMask & ~Mtm -> disabledNodeMask ) );
944
+ elog (LOG , "Receive response %s for transaction %s status %s for node %d, votedMask %llx, participantsMask %llx" ,
945
+ MtmNodeStatusMnem [ msg -> status ] , msg -> gid , MtmNodeStatusMnem [ ts -> status ] , node , (long long )ts -> votedMask , (long long )(ts -> participantsMask & ~Mtm -> disabledNodeMask ) );
947
946
}
948
947
}
949
948
continue ;
@@ -983,8 +982,8 @@ static void MtmReceiver(Datum arg)
983
982
if ((~msg -> disabledNodeMask & Mtm -> disabledNodeMask ) != 0 ) {
984
983
/* Coordinator's disabled mask is wider than of this node: so reject such transaction to avoid
985
984
commit on smaller subset of nodes */
986
- elog (WARNING , "Coordinator of distributed transaction see less nodes than node %d: %lx instead of %lx " ,
987
- node , (long ) Mtm -> disabledNodeMask , (long ) msg -> disabledNodeMask );
985
+ elog (WARNING , "Coordinator of distributed transaction see less nodes than node %d: %llx instead of %llx " ,
986
+ node , (long long ) Mtm -> disabledNodeMask , (long long ) msg -> disabledNodeMask );
988
987
MtmAbortTransaction (ts );
989
988
}
990
989
if ((ts -> participantsMask & ~Mtm -> disabledNodeMask & ~ts -> votedMask ) == 0 ) {
@@ -993,7 +992,7 @@ static void MtmReceiver(Datum arg)
993
992
MtmWakeUpBackend (ts );
994
993
} else {
995
994
Assert (ts -> status == TRANSACTION_STATUS_IN_PROGRESS );
996
- MTM_LOG1 ("Transaction %s is prepared (status=%d participants=%lx disabled=%lx, voted=%lx)" ,
995
+ MTM_LOG2 ("Transaction %s is prepared (status=%d participants=%lx disabled=%lx, voted=%lx)" ,
997
996
ts -> gid , ts -> status , ts -> participantsMask , Mtm -> disabledNodeMask , ts -> votedMask );
998
997
ts -> isPrepared = true;
999
998
if (ts -> isTwoPhase ) {
0 commit comments