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