Re: [HACKERS] Transactions involving multiple postgres foreign servers - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: [HACKERS] Transactions involving multiple postgres foreign servers
Date
Msg-id CAFjFpRfWcKRoyw4PQQkQZbVqJE_0amx=1wfdxxk4dOCDgK8pMA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Transactions involving multiple postgres foreign servers  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: [HACKERS] Transactions involving multiple postgres foreign servers
List pgsql-hackers
On Thu, Dec 28, 2017 at 11:08 AM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
>> (1)
>> Why don't you use the existing global variable MyXactFlags instead of the new TransactionDidWrite?  Or, how about
usingXactLastRecEnd != 0 to determine the transaction did any writes?  When the transaction only modified temporary
tableson the local database and some data on one remote database, I think 2pc is unnecessary. 
>
> Perhaps we can use (XactLastRecEnd != 0 && markXidCommitted) to see if
> we did any writes on local node which requires the atomic commit. Will
> fix.
>

I haven't checked how much code it needs to track whether the local
transaction wrote anything. But probably we can post-pone this
optimization. If it's easy to incorporate, it's good to have in the
first set itself.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


pgsql-hackers by date:

Previous
From: Beena Emerson
Date:
Subject: Re: [HACKERS] Runtime Partition Pruning
Next
From: Michael Paquier
Date:
Subject: Re: Increasing timeout of poll_query_until for TAP tests