Re: Slow catchup of 2PC (twophase) transactions on replica in LR

From: vignesh C <vignesh21(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, Ajin Cherian <itsajin(at)gmail(dot)com>
Subject: Re: Slow catchup of 2PC (twophase) transactions on replica in LR
Date: 2024-07-20 16:01:06
Message-ID: CALDaNm1pxD4MHnwJffLcQrZAp-LzRU4b4K=RC6QhnV4k1j3a0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 18 Jul 2024 at 07:41, Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Peter,
>
> Thanks for giving comments! PSA new version.

Couple of suggestions:
1) How will user know which all transactions should be rolled back
since the prepared transaction name will be different in subscriber
like pg_gid_16398_750, can we mention some info on how user can
identify these prepared transactions that should be rolled back in the
subscriber or if this information is already available can we point it
from here:
+ When altering <link
linkend="sql-createsubscription-params-with-two-phase"><literal>two_phase</literal></link>
+ from <literal>true</literal> to <literal>false</literal>, the backend
+ process reports and an error if any prepared transactions done by the
+ logical replication worker (from when <literal>two_phase</literal>
+ parameter was still <literal>true</literal>) are found. You can resolve
+ prepared transactions on the publisher node, or manually roll back them
+ on the subscriber, and then try again.

2) I'm not sure if InvalidRepOriginId is correct here, how about
using OidIsValid in the below:
+void
+TwoPhaseTransactionGid(Oid subid, TransactionId xid, char *gid, int szgid)
+{
+ Assert(subid != InvalidRepOriginId);

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2024-07-20 18:14:05 Re: Use read streams in CREATE DATABASE command when the strategy is wal_log
Previous Message Ahmed Yarub Hani Al Nuaimi 2024-07-20 16:00:05 Re: Lock-free compaction. Why not?