Re: Handle infinite recursion in logical replication setup

From: vignesh C <vignesh21(at)gmail(dot)com>
To: "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(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-06-30 16:10:14
Message-ID: CALDaNm1qrk3mPbEjTYgg7GL_0J9k-OHb+Q2ubeP=_Mt-2zmCZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 30, 2022 at 9:17 AM shiy(dot)fnst(at)fujitsu(dot)com
<shiy(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Tue, Jun 28, 2022 2:18 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > Thanks for the comments, the attached v25 patch has the changes for the
> > same.
> >
>
> Thanks for updating the patch. Here are some comments.
>
> 0002 patch:
> ==============
> 1.
> +# Test the CREATE SUBSCRIPTION 'origin' parameter and its interaction with
> +# 'copy_data' parameter.
>
> It seems we should move "and its interaction with 'copy_data' parameter" to
> 0003 patch.

Modified

> 0003 patch
> ==============
> 1.
> When using ALTER SUBSCRIPTION ... REFRESH, subscription will throw an error if
> any table is subscribed in publisher, even if the table has been subscribed
> before refresh (which won't do the initial copy when refreshing). It looks the
> previously subscribed tables don't need this check. Would it be better that we
> only check the tables which need to do the initial copy?

Modified

> 2.
> + errmsg("table:%s.%s might have replicated data in the publisher",
> + nspname, relname),
>
> I think the table name needs to be enclosed in double quotes, which is
> consistent with other messages.

Modified

Thanks for the comments, the attached v26 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v26-0001-Add-a-missing-test-to-verify-only-local-paramete.patch text/x-patch 4.3 KB
v26-0004-Document-bidirectional-logical-replication-steps.patch text/x-patch 13.5 KB
v26-0002-Skip-replication-of-non-local-data.patch text/x-patch 57.0 KB
v26-0003-Check-and-throw-an-error-if-publication-tables-w.patch text/x-patch 41.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Chavez 2022-06-30 16:51:22 Add red-black tree missing comparison searches
Previous Message Michel Pelletier 2022-06-30 16:09:17 PATCH: Add Table Access Method option to pgbench