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>, 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-05-20 10:02:11
Message-ID: CALDaNm11qBwm_4h0FdaMBfrVnADPa0qLvDBtNTjXSoj_0vB4Ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 19, 2022 at 2:12 PM shiy(dot)fnst(at)fujitsu(dot)com
<shiy(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Wed, May 4, 2022 2:47 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > Thanks for the comments, the attached v13 patch has the changes for the same.
> >
>
> Here are some comments on v13-0002 patch.
>
> 1)
> + * Throw an error so that the user can take care of the initial data
> + * copying and then create subscription with copy_data off.
>
> Should "with copy_data off" be changed to "with copy_data off or force"?

Modified

> 2)
> case ALTER_SUBSCRIPTION_ADD_PUBLICATION:
> case ALTER_SUBSCRIPTION_DROP_PUBLICATION:
> ...
> /*
> * See ALTER_SUBSCRIPTION_REFRESH for details why this is
> * not allowed.
> */
> if (sub->twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED && opts.copy_data)
>
> I think we need some changes here, too. Should it be modified to:
> if (sub->twophasestate == LOGICALREP_TWOPHASE_STATE_ENABLED && IS_COPY_DATA_ON_OR_FORCE(opts.copy_data))

Modified

Thanks for the comments, the v14 patch attached at [1] has the changes
for the same.
[1] - https://www.postgresql.org/message-id/CALDaNm0xuYy35vOudVHBjov3fQ%3DjBRHJHKUUN9VarqO%3DYqtaxg%40mail.gmail.com

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2022-05-20 10:31:17 Re: Build-farm - intermittent error in 031_column_list.pl
Previous Message Heikki Linnakangas 2022-05-20 10:01:31 Re: PG15 beta1 sort performance regression due to Generation context change