@@ -739,7 +739,7 @@ process_remote_commit(StringInfo in)
739739Assert (!TransactionIdIsValid (MtmGetCurrentTransactionId ()));
740740csn = pq_getmsgint64 (in );
741741/*
742- * Since our recovery method allows undershoot ofcsn , we can receive
742+ * Since our recovery method allows undershoot oflsn , we can receive
743743 * some already committed transactions. And in case of donor node reboot
744744 * xid<->csn mapping for them will be lost. However we must filter such
745745 * transactions in walreceiver before this code. --sk
@@ -750,7 +750,10 @@ process_remote_commit(StringInfo in)
750750MtmResetTransaction ();
751751StartTransactionCommand ();
752752MtmBeginSession (origin_node );
753- MtmSetCurrentTransactionCSN (csn );
753+ if (csn == INVALID_CSN && Mtm -> status == MTM_RECOVERY )
754+ MtmSetCurrentTransactionCSN (MtmAssignCSN ());
755+ else
756+ MtmSetCurrentTransactionCSN (csn );
754757MtmSetCurrentTransactionGID (gid );
755758FinishPreparedTransaction (gid , true);
756759MTM_LOG2 ("Distributed transaction %s is committed" ,gid );