Re: [HACKERS] Transactions involving multiple postgres foreign servers

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Antonin Houska <ah(at)cybertec(dot)at>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Transactions involving multiple postgres foreign servers
Date: 2018-01-09 14:49:35
Message-ID: CAD21AoD5Pxm3r7SM02K80huDTPJwOR=JKHc9tW_eMjpEDU7_=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 9, 2018 at 11:38 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Dec 27, 2017 at 9:40 PM, Tsunakawa, Takayuki
> <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
>> (1)
>> Why don't you use the existing global variable MyXactFlags instead of the new TransactionDidWrite? Or, how about using XactLastRecEnd != 0 to determine the transaction did any writes? When the transaction only modified temporary tables on the local database and some data on one remote database, I think 2pc is unnecessary.
>
> If I understand correctly, XactLastRecEnd can be set by, for example,
> a HOT cleanup record, so that doesn't seem like a good thing to use.

Yes, that's right.

> Whether we need to use 2PC across remote nodes seems like it shouldn't
> depend on whether a local SELECT statement happened to do a HOT
> cleanup or not.

So I think we need to check if the top transaction is invalid or not as well.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2018-01-09 15:02:51 pgsql: Improve scripting language in pgbench
Previous Message Robert Haas 2018-01-09 14:46:42 Re: Incorrect comment for expand_single_inheritance_child