@@ -719,7 +719,7 @@ BroadcastStmt(char const * sql, unsigned expectedStatus,
719
719
PGresult * res = PQgetResult (entry -> conn );
720
720
721
721
elog (WARNING , "Failed to send command %s" , sql );
722
- pgfdw_report_error (ERROR , res , entry -> conn , true, sql );
722
+ pgfdw_report_error (WARNING , res , entry -> conn , true, sql );
723
723
PQclear (res );
724
724
}
725
725
}
@@ -818,11 +818,13 @@ pgfdw_xact_callback(XactEvent event, void *arg)
818
818
bool res ;
819
819
char * sql ;
820
820
821
- fdwTransState -> gid = psprintf ("fdw:%llx:%lld:%d:%d" ,
822
- (long long ) GetSystemIdentifier (),
823
- (long long ) GetCurrentTimestamp (),
824
- MyProcPid ,
825
- ++ two_phase_xact_count );
821
+ fdwTransState -> gid = psprintf ("fdw:%lld:%llx:%u:%d:%d:%d" ,
822
+ (long long ) GetCurrentTimestamp (),
823
+ (long long ) GetSystemIdentifier (),
824
+ GetCurrentTransactionIdIfAny (),
825
+ fdwTransState -> nparticipants ,
826
+ MyProcPid ,
827
+ ++ two_phase_xact_count );
826
828
827
829
/* Broadcast PREPARE */
828
830
sql = psprintf ("PREPARE TRANSACTION '%s'" , fdwTransState -> gid );
@@ -841,7 +843,7 @@ pgfdw_xact_callback(XactEvent event, void *arg)
841
843
goto error ;
842
844
843
845
/* select maximal global csn */
844
- if (my_csn > max_csn )
846
+ if (include_local_tx && my_csn > max_csn )
845
847
max_csn = my_csn ;
846
848
847
849
/* Broadcast pg_global_snaphot_assign() */
0 commit comments