Re: Logical Replication vs. 2PC - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: Logical Replication vs. 2PC
Date
Msg-id CAFiTN-vNT0vcjewx=kvnfq0AsrALgTrpk68=ikSMHbxVVVwQAw@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication vs. 2PC  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Logical Replication vs. 2PC
List pgsql-hackers
On Sat, Mar 20, 2021 at 7:50 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Fri, Mar 19, 2021 at 9:22 PM Markus Wanner
> <markus.wanner@enterprisedb.com> wrote:

> So, I think you are using xid of publisher and origin_id of
> subscription to achieve uniqueness because both will be accessible in
> prepare and commit prepared. Right? If so, I think that will work out
> here as well. But if we think to use xid generated on subscriber then
> we need to keep some mapping of original GID sent by publisher and GID
> generated by us (origin+xid of subscription) because, at commit
> prepared time, we won't know that xid.

I agree that if we use (publisher's xid + subscriber origin id)
instead of GID,  we can resolve this deadlock issue.  I was also
thinking that is it okay to change the prepared transaction name on
the subscriber? I mean instead of GID if we use some other name then
imagine a case where a user has prepared some transaction on the
publisher and then tries to commit that on the subscriber using the
prepared transaction name, then it will not work.  But maybe this is
not really a practical use case.  I mean why anyone would want to
prepare a transaction on the publisher and commit that prepared
transaction directly on the subscriber.  Thoughts?

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: [HACKERS] Custom compression methods
Next
From: Julien Rouhaud
Date:
Subject: Re: [PATCH] Hooks at XactCommand level