Skip to content

Commit b7520b7

Browse files
committed
respect new changing_xact_state variable
1 parent 7607a30 commit b7520b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/postgres_fdw/connection.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ begin_remote_xact(ConnCacheEntry *entry)
450450
elog(DEBUG3, "starting remote transaction on connection %p",
451451
entry->conn);
452452

453-
if (TransactionIdIsValid(gxid))
453+
if (UseTsDtmTransactions && TransactionIdIsValid(gxid))
454454
{
455455
char stmt[64];
456456
snprintf(stmt, sizeof(stmt), "select public.dtm_join_transaction(%d)", gxid);
@@ -873,7 +873,9 @@ pgfdw_xact_callback(XactEvent event, void *arg)
873873
pgfdw_reject_incomplete_xact_state_change(entry);
874874

875875
/* Commit all remote transactions during pre-commit */
876-
do_sql_send_command(entry->conn, "COMMIT TRANSACTION");
876+
entry->changing_xact_state = true;
877+
do_sql_command(entry->conn, "COMMIT TRANSACTION");
878+
entry->changing_xact_state = false;
877879
continue;
878880

879881
case XACT_EVENT_PRE_PREPARE:

0 commit comments

Comments
 (0)