Re: Transactions involving multiple postgres foreign servers, take 2

From: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Muhammad Usama <m(dot)usama(at)gmail(dot)com>, amul sul <sulamul(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Ildar Musin <ildar(at)adjust(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Chris Travers <chris(dot)travers(at)adjust(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Subject: Re: Transactions involving multiple postgres foreign servers, take 2
Date: 2020-06-03 06:32:17
Message-ID: CA+fd4k6MgrBVTqbWwSiR2=Ztsw95d=xzt5RAr5z2_cGf1WRzUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 3 Jun 2020 at 14:50, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Tue, May 19, 2020 at 12:33 PM Masahiko Sawada
> <masahiko(dot)sawada(at)2ndquadrant(dot)com> wrote:
> >
> > I think that the current three values are useful for users. The
> > ‘required’ mode is used when users want to ensure all writes involved
> > with the transaction are committed atomically. That being said, as
> > some FDW plugin might not support the prepare API we cannot force
> > users to use this mode all the time when using atomic commit.
> > Therefore ‘prefer’ mode would be useful for this case. Both modes use
> > 2pc only when it's required for atomic commit.
> >
> > So what do you think my idea that adding the behavior you proposed as
> > another new mode? As it’s better to keep the first version simple as
> > much as possible
> >
>
> If the intention is to keep the first version simple, then why do we
> want to support any mode other than 'required'? I think it will limit
> its usage for the cases where 2PC can be used only when all FDWs
> involved support Prepare API but if that helps to keep the design and
> patch simpler then why not just do that for the first version and then
> extend it later. OTOH, if you think it will be really useful to keep
> other modes, then also we could try to keep those in separate patches
> to facilitate the review and discussion of the core feature.

‘disabled’ is the fundamental mode. We also need 'disabled' mode,
otherwise existing FDW won't work. I was concerned that many FDW
plugins don't implement FDW transaction APIs yet when users start
using this feature. But it seems to be a good idea to move 'prefer'
mode to a separate patch while leaving 'required'. I'll do that in the
next version patch.

Regards,

--
Masahiko Sawada http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2020-06-03 06:51:10 Re: Default gucs for EXPLAIN
Previous Message Kyotaro Horiguchi 2020-06-03 06:18:19 Re: elog(DEBUG2 in SpinLocked section.