@@ -1111,38 +1111,31 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
1111
1111
MtmLock (LW_EXCLUSIVE );
1112
1112
ts = (MtmTransState * )hash_search (MtmXid2State , & x -> xid , HASH_FIND , NULL );
1113
1113
Assert (ts != NULL );
1114
- //if (x->gid[0]) MTM_LOG1("Preparing transaction %d (%s) at %ld", x->xid, x->gid, MtmGetCurrentTime());
1115
1114
if (!MtmIsCoordinator (ts ) || Mtm -> status == MTM_RECOVERY ) {
1116
- MTM_TXTRACE (x , "recovery?" );
1117
1115
MTM_LOG3 ("Preparing transaction %d (%s) at %ld" , x -> xid , x -> gid , MtmGetCurrentTime ());
1118
1116
Assert (x -> gid [0 ]);
1119
1117
ts -> votingCompleted = true;
1120
- MTM_TXTRACE (x , "recovery? 1" );
1121
1118
if (Mtm -> status != MTM_RECOVERY /* || Mtm->recoverySlot != MtmReplicationNodeId*/ ) {
1122
- MTM_TXTRACE (x , "recovery? 2" );
1123
1119
MtmSend2PCMessage (ts , MSG_PREPARED ); /* send notification to coordinator */
1124
1120
if (!MtmUseDtm ) {
1125
1121
ts -> status = TRANSACTION_STATUS_UNKNOWN ;
1126
1122
}
1127
1123
} else {
1128
- MTM_TXTRACE (x , "recovery? 3" );
1129
1124
ts -> status = TRANSACTION_STATUS_UNKNOWN ;
1130
1125
}
1131
- MTM_TXTRACE (x , "recovery? 4" );
1132
1126
MtmUnlock ();
1133
- MTM_TXTRACE (x , "recovery? 5" );
1134
1127
MtmResetTransaction ();
1135
- MTM_TXTRACE (x , "recovery? 6" );
1136
- } else if (!ts -> isLocal ) {
1137
- MTM_TXTRACE (x , "not recovery?" );
1138
- Mtm2PCVoting (x , ts );
1128
+ } else {
1129
+ if (!ts -> isLocal ) {
1130
+ Mtm2PCVoting (x , ts );
1131
+ } else {
1132
+ ts -> votingCompleted = true;
1133
+ }
1139
1134
MtmUnlock ();
1140
1135
if (x -> isTwoPhase ) {
1141
1136
MtmResetTransaction ();
1142
1137
}
1143
1138
}
1144
- MTM_TXTRACE (x , "recovery? 7" );
1145
- //if (x->gid[0]) MTM_LOG1("Prepared transaction %d (%s) csn=%ld at %ld: %d", x->xid, x->gid, ts->csn, MtmGetCurrentTime(), ts->status);
1146
1139
if (Mtm -> inject2PCError == 3 ) {
1147
1140
Mtm -> inject2PCError = 0 ;
1148
1141
elog (ERROR , "ERROR INJECTION for transaction %s (%lu)" , x -> gid , (long )x -> xid );
@@ -1182,6 +1175,8 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
1182
1175
MtmLock (LW_EXCLUSIVE );
1183
1176
1184
1177
Mtm2PCVoting (x , ts );
1178
+ } else {
1179
+ ts -> status = TRANSACTION_STATUS_UNKNOWN ;
1185
1180
}
1186
1181
1187
1182
x -> xid = ts -> xid ;
0 commit comments