Re: Handle infinite recursion in logical replication setup

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Handle infinite recursion in logical replication setup
Date: 2022-07-12 09:28:04
Message-ID: CALDaNm0w4vkQv8SSrj8h2QbDGVP8k1fDpmBjAD=Er6Ywew_94g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 12, 2022 at 9:51 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Tue, Jul 12, 2022 at 8:43 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > On Mon, Jul 11, 2022 at 9:11 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> > >
> > > Here are my review comments for the v30* patches:
> > >
> > > ========
> > > v30-0001
> > > ========
> > >
> > > 1.1 <general>
> > >
> > > I was wondering if it is better to implement a new defGetOrigin method
> > > now instead of just using the defGetString to process the 'origin',
> > > since you may need to do that in future anyway if the 'origin' name is
> > > planned to become specifiable by the user. OTOH maybe you prefer to
> > > change this code later when the time comes. I am not sure what way is
> > > best.
> >
> > I preferred to do that change when the feature is getting extended.
> >
>
> +1.
>
> *
> +$node_C->safe_psql(
> + 'postgres', "
> + DELETE FROM tab");
> +$node_B->safe_psql(
> + 'postgres', "
> + DELETE FROM tab where a = 32");
> +
> +$node_A->wait_for_catchup($subname_BA);
> +$node_B->wait_for_catchup($subname_AB);
>
> Here, don't we need to use node_C instead of node_A for waiting as we
> have performed an operation on node_C?

No need to wait for node_C as we have dropped the subscription before
the delete operation. I have added the comment to make it clear.
The attached v32 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v32-0002-Check-and-throw-an-error-if-publication-tables-w.patch text/x-patch 43.1 KB
v32-0003-Document-bidirectional-logical-replication-steps.patch text/x-patch 13.5 KB
v32-0001-Skip-replication-of-non-local-data.patch text/x-patch 57.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2022-07-12 10:10:39 Re: CREATE TABLE ( .. STORAGE ..)
Previous Message Peter Eisentraut 2022-07-12 09:26:46 Re: Cleaning up historical portability baggage