Re: Handle infinite recursion in logical replication setup

2023-08-16 Thread Peter Eisentraut
On 09.08.23 04:50, Peter Smith wrote: On Tue, Aug 8, 2023 at 6:52 PM Amit Kapila wrote: On Tue, Aug 8, 2023 at 1:50 PM Peter Eisentraut wrote: This patch added the following error message: errdetail_plural("Subscribed publication %s is subscribing to other publications.", "Subscribed

Re: Handle infinite recursion in logical replication setup

2023-08-09 Thread Amit Kapila
On Wed, Aug 9, 2023 at 10:59 AM Peter Smith wrote: > > > Example output using the patch look like this: > > SINGLULAR > test_sub=# create subscription sub_test connection 'dbname=test_pub' > publication pub_all_at_pub with(origin=NONE); > WARNING: subscription "sub_test" requested copy_data with

Re: Handle infinite recursion in logical replication setup

2023-08-08 Thread Peter Smith
On Wed, Aug 9, 2023 at 2:44 PM Amit Kapila wrote: > > On Wed, Aug 9, 2023 at 8:20 AM Peter Smith wrote: > > > > On Tue, Aug 8, 2023 at 6:52 PM Amit Kapila wrote: > > > > > > On Tue, Aug 8, 2023 at 1:50 PM Peter Eisentraut > > > wrote: > > > > > > > > This patch added the following error

Re: Handle infinite recursion in logical replication setup

2023-08-08 Thread Amit Kapila
On Wed, Aug 9, 2023 at 8:20 AM Peter Smith wrote: > > On Tue, Aug 8, 2023 at 6:52 PM Amit Kapila wrote: > > > > On Tue, Aug 8, 2023 at 1:50 PM Peter Eisentraut > > wrote: > > > > > > This patch added the following error message: > > > > > > errdetail_plural("Subscribed publication %s is

Re: Handle infinite recursion in logical replication setup

2023-08-08 Thread Peter Smith
On Tue, Aug 8, 2023 at 6:52 PM Amit Kapila wrote: > > On Tue, Aug 8, 2023 at 1:50 PM Peter Eisentraut wrote: > > > > This patch added the following error message: > > > > errdetail_plural("Subscribed publication %s is subscribing to other > > publications.", > > "Subscribed publications %s are

Re: Handle infinite recursion in logical replication setup

2023-08-08 Thread Amit Kapila
On Tue, Aug 8, 2023 at 1:50 PM Peter Eisentraut wrote: > > On 12.09.22 07:23, vignesh C wrote: > > On Fri, 9 Sept 2022 at 11:12, Amit Kapila wrote: > >> > >> On Thu, Sep 8, 2022 at 9:32 AM vignesh C wrote: > >>> > >>> > >>> The attached patch has the changes to handle the same. > >>> > >> > >>

Re: Handle infinite recursion in logical replication setup

2023-08-08 Thread Peter Eisentraut
On 12.09.22 07:23, vignesh C wrote: On Fri, 9 Sept 2022 at 11:12, Amit Kapila wrote: On Thu, Sep 8, 2022 at 9:32 AM vignesh C wrote: The attached patch has the changes to handle the same. Pushed. I am not completely sure whether we want the remaining documentation patch in this thread

Re: Handle infinite recursion in logical replication setup

2023-01-10 Thread Amit Kapila
On Tue, Jan 10, 2023 at 11:24 PM Jonathan S. Katz wrote: > > On 1/10/23 10:17 AM, Amit Kapila wrote: > > On Tue, Jan 10, 2023 at 8:13 AM Jonathan S. Katz > > wrote: > > > One can use local or higher > > for reducing the latency for COMMIT when synchronous replication is > > used in the

Re: Handle infinite recursion in logical replication setup

2023-01-10 Thread Jonathan S. Katz
On 1/10/23 10:17 AM, Amit Kapila wrote: On Tue, Jan 10, 2023 at 8:13 AM Jonathan S. Katz wrote: This consistently created the deadlock in my testing. Discussing with Masahiko off-list, this is due to a deadlock from 4 processes: the walsenders on A and B, and the apply workers on A and B.

Re: Handle infinite recursion in logical replication setup

2023-01-10 Thread Amit Kapila
On Tue, Jan 10, 2023 at 8:13 AM Jonathan S. Katz wrote: > > On 9/12/22 1:23 AM, vignesh C wrote: > > On Fri, 9 Sept 2022 at 11:12, Amit Kapila wrote: > > > > Thanks for pushing the patch. I have closed this entry in commitfest. > > I will wait for some more time and see the response regarding

Re: Handle infinite recursion in logical replication setup

2023-01-09 Thread Jonathan S. Katz
On 9/12/22 1:23 AM, vignesh C wrote: On Fri, 9 Sept 2022 at 11:12, Amit Kapila wrote: On Thu, Sep 8, 2022 at 9:32 AM vignesh C wrote: The attached patch has the changes to handle the same. Pushed. I am not completely sure whether we want the remaining documentation patch in this thread

Re: Handle infinite recursion in logical replication setup

2022-09-11 Thread vignesh C
On Fri, 9 Sept 2022 at 11:12, Amit Kapila wrote: > > On Thu, Sep 8, 2022 at 9:32 AM vignesh C wrote: > > > > > > The attached patch has the changes to handle the same. > > > > Pushed. I am not completely sure whether we want the remaining > documentation patch in this thread in its current form

Re: Handle infinite recursion in logical replication setup

2022-09-08 Thread Amit Kapila
On Thu, Sep 8, 2022 at 9:32 AM vignesh C wrote: > > > The attached patch has the changes to handle the same. > Pushed. I am not completely sure whether we want the remaining documentation patch in this thread in its current form or by modifying it. Johnathan has shown some interest in it. I feel

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread vignesh C
On Thu, 8 Sept 2022 at 08:57, vignesh C wrote: > > On Thu, 8 Sept 2022 at 08:23, Amit Kapila wrote: > > > > On Thu, Sep 8, 2022 at 7:57 AM vignesh C wrote: > > > > > > There is a buildfarm failure on mylodon at [1] because of the new test > > > added. I will analyse and share the findings for

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread vignesh C
On Thu, 8 Sept 2022 at 08:23, Amit Kapila wrote: > > On Thu, Sep 8, 2022 at 7:57 AM vignesh C wrote: > > > > There is a buildfarm failure on mylodon at [1] because of the new test > > added. I will analyse and share the findings for the same. > > > > [1] - > >

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread Amit Kapila
On Thu, Sep 8, 2022 at 7:57 AM vignesh C wrote: > > There is a buildfarm failure on mylodon at [1] because of the new test > added. I will analyse and share the findings for the same. > > [1] - > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mylodon=2022-09-08%2001%3A40%3A27 > The log

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread vignesh C
Hi, There is a buildfarm failure on mylodon at [1] because of the new test added. I will analyse and share the findings for the same. [1] - https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mylodon=2022-09-08%2001%3A40%3A27 Regards, Vignesh On Wed, 7 Sept 2022 at 17:10, vignesh C

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread vignesh C
On Wed, 7 Sept 2022 at 14:34, Amit Kapila wrote: > > On Wed, Sep 7, 2022 at 9:53 AM vignesh C wrote: > > > > Thanks for the comments, the attached v47 patch has the changes for the > > same. > > > > V47-0001* looks good to me apart from below minor things. I would like > to commit this tomorrow

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread Amit Kapila
On Wed, Sep 7, 2022 at 9:53 AM vignesh C wrote: > > Thanks for the comments, the attached v47 patch has the changes for the same. > V47-0001* looks good to me apart from below minor things. I would like to commit this tomorrow unless there are more comments on it. Few minor suggestions:

Re: Handle infinite recursion in logical replication setup

2022-09-07 Thread Amit Kapila
On Wed, Sep 7, 2022 at 1:09 PM shiy.f...@fujitsu.com wrote: > > On Wed, Sep 7, 2022 12:23 PM vignesh C wrote: > > > > > > Thanks for the comments, the attached v47 patch has the changes for the > > same. > > > > Thanks for updating the patch. > > Here is a comment. > > + for (i = 0; i <

RE: Handle infinite recursion in logical replication setup

2022-09-07 Thread shiy.f...@fujitsu.com
On Wed, Sep 7, 2022 12:23 PM vignesh C wrote: > > > Thanks for the comments, the attached v47 patch has the changes for the > same. > Thanks for updating the patch. Here is a comment. + for (i = 0; i < subrel_count; i++) + { + Oid relid =

Re: Handle infinite recursion in logical replication setup

2022-09-06 Thread vignesh C
On Tue, 6 Sept 2022 at 15:25, Amit Kapila wrote: > > On Tue, Sep 6, 2022 at 9:31 AM wangw.f...@fujitsu.com > wrote: > > > > On Tues, 6 Sept 2022 at 11:14, vignesh C wrote: > > > Thanks for the comments, the attached patch has the changes for the same. > > > > Thanks for updating the patch. > >

Re: Handle infinite recursion in logical replication setup

2022-09-06 Thread vignesh C
On Tue, 6 Sept 2022 at 09:31, wangw.f...@fujitsu.com wrote: > > On Tues, 6 Sept 2022 at 11:14, vignesh C wrote: > > Thanks for the comments, the attached patch has the changes for the same. > > Thanks for updating the patch. > > Here is one comment for 0001 patch. > 1. The query in function

Re: Handle infinite recursion in logical replication setup

2022-09-06 Thread vignesh C
On Tue, 6 Sept 2022 at 09:31, shiy.f...@fujitsu.com wrote: > > On Tue, Sep 6, 2022 11:14 AM vignesh C wrote: > > > > Thanks for the comments, the attached patch has the changes for the same. > > > > Thanks for updating the patch. Here are some comments. > > 1. > + if (subrel_count) > +

Re: Handle infinite recursion in logical replication setup

2022-09-06 Thread Amit Kapila
On Tue, Sep 6, 2022 at 9:31 AM wangw.f...@fujitsu.com wrote: > > On Tues, 6 Sept 2022 at 11:14, vignesh C wrote: > > Thanks for the comments, the attached patch has the changes for the same. > > Thanks for updating the patch. > > Here is one comment for 0001 patch. > 1. The query in function

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread Peter Smith
Thanks for addressing my previous review comments. I have no more comments for v46*. -- Kind Regards, Peter Smith. Fujitsu Australia

RE: Handle infinite recursion in logical replication setup

2022-09-05 Thread wangw.f...@fujitsu.com
On Tues, 6 Sept 2022 at 11:14, vignesh C wrote: > Thanks for the comments, the attached patch has the changes for the same. Thanks for updating the patch. Here is one comment for 0001 patch. 1. The query in function check_publications_origin. + appendStringInfoString(, +

RE: Handle infinite recursion in logical replication setup

2022-09-05 Thread shiy.f...@fujitsu.com
On Tue, Sep 6, 2022 11:14 AM vignesh C wrote: > > Thanks for the comments, the attached patch has the changes for the same. > Thanks for updating the patch. Here are some comments. 1. + if (subrel_count) + { + /* +* In case of ALTER SUBSCRIPTION ...

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread vignesh C
On Mon, 5 Sept 2022 at 15:10, Amit Kapila wrote: > > On Mon, Sep 5, 2022 at 9:47 AM Peter Smith wrote: > > > > Here are my review comments for v45-0001: > > > > == > > > > 1. doc/src/sgml/logical-replication.sgml > > > > > >To find which tables might potentially include non-local

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread vignesh C
On Mon, 5 Sept 2022 at 09:47, Peter Smith wrote: > > Here are my review comments for v45-0001: > > == > > 1. doc/src/sgml/logical-replication.sgml > > >To find which tables might potentially include non-local origins (due to >other subscriptions created on the publisher) try this

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread Amit Kapila
On Mon, Sep 5, 2022 at 9:47 AM Peter Smith wrote: > > Here are my review comments for v45-0001: > > == > > 1. doc/src/sgml/logical-replication.sgml > > >To find which tables might potentially include non-local origins (due to >other subscriptions created on the publisher) try this

Re: Handle infinite recursion in logical replication setup

2022-09-04 Thread Peter Smith
Here are my review comments for v45-0001: == 1. doc/src/sgml/logical-replication.sgml To find which tables might potentially include non-local origins (due to other subscriptions created on the publisher) try this SQL query: SELECT DISTINCT N.nspname AS schemaname, C.relname AS

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread vignesh C
On Fri, 2 Sept 2022 at 13:51, Peter Smith wrote: > > Here are my review comments for the latest patch v44-0001. > > == > > 1. doc/src/sgml/logical-replication.sgml > > + > + Specifying origins for subscription > > I thought the title is OK, but maybe can be better. OTOH, I am not > sure if

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread vignesh C
On Mon, 29 Aug 2022 at 16:35, Amit Kapila wrote: > > On Wed, Aug 24, 2022 at 7:27 PM vignesh C wrote: > > > > Since there was no objections to change it to throw a warning, I have > > made the changes for the same. > > > > Review comments for v42-0001* > == > 1. Can we

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread Peter Smith
On Fri, Sep 2, 2022 at 6:21 PM Peter Smith wrote: > > Here are my review comments for the latest patch v44-0001. > ... > > 6. src/backend/commands/subscriptioncmds.c > > + if (bsearch(, subrel_local_oids, > + subrel_count, sizeof(Oid), oid_cmp)) > + isnewtable = false; > > SUGGESTION (search PG

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread Peter Smith
Here are my review comments for the latest patch v44-0001. == 1. doc/src/sgml/logical-replication.sgml + + Specifying origins for subscription I thought the title is OK, but maybe can be better. OTOH, I am not sure if my suggestions below are improvements or not. Anyway, even if the

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Thu, 1 Sept 2022 at 09:19, Amit Kapila wrote: > > On Wed, Aug 31, 2022 at 11:35 AM Peter Smith wrote: > > > > Here are my review comments for v43-0001. > > > > == > > > > 1. Commit message > > > > The initial copy phase has no way to know the origin of the row data, > > so if 'copy_data =

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Thu, 1 Sept 2022 at 08:01, shiy.f...@fujitsu.com wrote: > > On Wed, Aug 31, 2022 1:06 AM vignesh C wrote: > > > > The attached v43 patch has the changes for the same. > > > > Thanks for updating the patch. > > Here is a comment on the 0001 patch. > > + if (!isnewtable) > +

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Wed, 31 Aug 2022 at 11:45, Peter Smith wrote: > > Here are some review comments for patch v43-0002: > > == > > 1. doc/src/sgml/ref/create_subscription.sgml > > @@ -403,7 +403,9 @@ CREATE SUBSCRIPTION class="parameter">subscription_name warning to notify the user to check the publisher

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Mon, 29 Aug 2022 at 16:35, Amit Kapila wrote: > > On Wed, Aug 24, 2022 at 7:27 PM vignesh C wrote: > > > > Since there was no objections to change it to throw a warning, I have > > made the changes for the same. > > > > Review comments for v42-0001* > == > 1. Can we

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Wed, 31 Aug 2022 at 11:35, Peter Smith wrote: > > Here are my review comments for v43-0001. > > == > > 1. Commit message > > The initial copy phase has no way to know the origin of the row data, > so if 'copy_data = true' in the step 4 below, log a warning to notify user > that potentially

Re: Handle infinite recursion in logical replication setup

2022-08-31 Thread Amit Kapila
On Wed, Aug 31, 2022 at 11:35 AM Peter Smith wrote: > > Here are my review comments for v43-0001. > > == > > 1. Commit message > > The initial copy phase has no way to know the origin of the row data, > so if 'copy_data = true' in the step 4 below, log a warning to notify user > that

RE: Handle infinite recursion in logical replication setup

2022-08-31 Thread shiy.f...@fujitsu.com
On Wed, Aug 31, 2022 1:06 AM vignesh C wrote: > > The attached v43 patch has the changes for the same. > Thanks for updating the patch. Here is a comment on the 0001 patch. + if (!isnewtable) + { + pfree(nspname); +

Re: Handle infinite recursion in logical replication setup

2022-08-31 Thread Peter Smith
On Wed, Aug 31, 2022 at 8:36 PM Amit Kapila wrote: > > On Wed, Aug 31, 2022 at 11:35 AM Peter Smith wrote: > > > > Here are my review comments for v43-0001. > > ... > > == > > > > 2. doc/src/sgml/ref/create_subscription.sgml > > > > + > > + If the subscription is created with origin =

Re: Handle infinite recursion in logical replication setup

2022-08-31 Thread Amit Kapila
On Wed, Aug 31, 2022 at 11:35 AM Peter Smith wrote: > > Here are my review comments for v43-0001. > > == > > 1. Commit message > > The initial copy phase has no way to know the origin of the row data, > so if 'copy_data = true' in the step 4 below, log a warning to notify user > that

Re: Handle infinite recursion in logical replication setup

2022-08-31 Thread Peter Smith
Here are some review comments for patch v43-0002: == 1. doc/src/sgml/ref/create_subscription.sgml @@ -403,7 +403,9 @@ CREATE SUBSCRIPTION subscription_name for + how copy_data and origin can be used + to set up replication between primaries. Regarding my earlier v43-0001 review

Re: Handle infinite recursion in logical replication setup

2022-08-31 Thread Peter Smith
Here are my review comments for v43-0001. == 1. Commit message The initial copy phase has no way to know the origin of the row data, so if 'copy_data = true' in the step 4 below, log a warning to notify user that potentially non-local data might have been copied. 1a. "in the step 4" -> "in

Re: Handle infinite recursion in logical replication setup

2022-08-30 Thread vignesh C
On Mon, 29 Aug 2022 at 12:01, Peter Smith wrote: > > Here are some review comments for patch v42-0002: > > == > > 1. doc/src/sgml/logical-replication.sgml > > copy_data = true > > There are a couple of these tags where there is a trailing space > before the . I guess it is doing no harm, but

Re: Handle infinite recursion in logical replication setup

2022-08-30 Thread vignesh C
On Mon, 29 Aug 2022 at 11:59, Peter Smith wrote: > > Here are some review comments for patch v42-0001: > > == > > 1. Commit message > > A later review comment below suggests some changes to the WARNING > message so if those changes are made then the example in this commit > message also needs

Re: Handle infinite recursion in logical replication setup

2022-08-29 Thread Amit Kapila
On Mon, Aug 29, 2022 at 11:59 AM Peter Smith wrote: > > Here are some review comments for patch v42-0001: > > ~~ > > 6. > > + warning to notify user to check the publisher tables. The user can ensure > + that publisher tables do not have data which has an origin associated > before > +

Re: Handle infinite recursion in logical replication setup

2022-08-29 Thread Amit Kapila
On Wed, Aug 24, 2022 at 7:27 PM vignesh C wrote: > > Since there was no objections to change it to throw a warning, I have > made the changes for the same. > Review comments for v42-0001* == 1. Can we improve the query in check_pub_table_subscribed() so that it doesn't

Re: Handle infinite recursion in logical replication setup

2022-08-29 Thread Peter Smith
Here are some review comments for patch v42-0002: == 1. doc/src/sgml/logical-replication.sgml copy_data = true There are a couple of these tags where there is a trailing space before the . I guess it is doing no harm, but it is doing no good either, so IMO better to get rid of the space.

Re: Handle infinite recursion in logical replication setup

2022-08-29 Thread Peter Smith
Here are some review comments for patch v42-0001: == 1. Commit message A later review comment below suggests some changes to the WARNING message so if those changes are made then the example in this commit message also needs to be modified. == 2.

Re: Handle infinite recursion in logical replication setup

2022-08-28 Thread Amit Kapila
On Mon, Aug 29, 2022 at 8:24 AM vignesh C wrote: > > On Fri, Aug 26, 2022 at 9:52 AM Dilip Kumar wrote: > > > > IMHO, since the user has specifically asked for origin=NONE but we do > > not have any way to detect the origin during initial sync so I think > > this could be documented and we can

Re: Handle infinite recursion in logical replication setup

2022-08-28 Thread vignesh C
On Fri, Aug 26, 2022 at 9:52 AM Dilip Kumar wrote: > > On Mon, Aug 22, 2022 at 9:19 AM houzj.f...@fujitsu.com > wrote: > > > > > Jonathan, Sawada-San, Hou-San, and others, what do you think is the best > > > way > > > to move forward here? > > > > I think it's fine to throw a WARNING in this

Re: Handle infinite recursion in logical replication setup

2022-08-25 Thread Dilip Kumar
On Mon, Aug 22, 2022 at 9:19 AM houzj.f...@fujitsu.com wrote: > > > Jonathan, Sawada-San, Hou-San, and others, what do you think is the best way > > to move forward here? > > I think it's fine to throw a WARNING in this case given that there is a > chance of inconsistent data. IMHO, since the

Re: Handle infinite recursion in logical replication setup

2022-08-24 Thread vignesh C
On Mon, Aug 22, 2022 at 9:19 AM houzj.f...@fujitsu.com wrote: > > On Thursday, August 18, 2022 11:13 AM Amit Kapila > wrote: > > > > On Wed, Aug 17, 2022 at 12:34 PM Peter Smith > > wrote: > > > > > > On Wed, Aug 17, 2022 at 4:33 PM Amit Kapila > > wrote: > > > > > > > > On Wed, Aug 17, 2022

RE: Handle infinite recursion in logical replication setup

2022-08-21 Thread houzj.f...@fujitsu.com
On Thursday, August 18, 2022 11:13 AM Amit Kapila wrote: > > On Wed, Aug 17, 2022 at 12:34 PM Peter Smith > wrote: > > > > On Wed, Aug 17, 2022 at 4:33 PM Amit Kapila > wrote: > > > > > > On Wed, Aug 17, 2022 at 8:48 AM houzj.f...@fujitsu.com > > > wrote: > > > > > > > > On Tuesday, August

Re: Handle infinite recursion in logical replication setup

2022-08-17 Thread Amit Kapila
On Wed, Aug 17, 2022 at 12:34 PM Peter Smith wrote: > > On Wed, Aug 17, 2022 at 4:33 PM Amit Kapila wrote: > > > > On Wed, Aug 17, 2022 at 8:48 AM houzj.f...@fujitsu.com > > wrote: > > > > > > On Tuesday, August 2, 2022 8:00 PM Amit Kapila > > > wrote: > > > > On Tue, Jul 26, 2022 at 9:07 AM

Re: Handle infinite recursion in logical replication setup

2022-08-17 Thread Peter Smith
On Wed, Aug 17, 2022 at 4:33 PM Amit Kapila wrote: > > On Wed, Aug 17, 2022 at 8:48 AM houzj.f...@fujitsu.com > wrote: > > > > On Tuesday, August 2, 2022 8:00 PM Amit Kapila > > wrote: > > > On Tue, Jul 26, 2022 at 9:07 AM Amit Kapila > > > wrote: > > > > Thanks for the summary. > > > > I

Re: Handle infinite recursion in logical replication setup

2022-08-17 Thread Amit Kapila
On Wed, Aug 17, 2022 at 8:48 AM houzj.f...@fujitsu.com wrote: > > On Tuesday, August 2, 2022 8:00 PM Amit Kapila > wrote: > > On Tue, Jul 26, 2022 at 9:07 AM Amit Kapila wrote: > > Thanks for the summary. > > I think it's fine to make the user use the copy_data option more carefully to >

RE: Handle infinite recursion in logical replication setup

2022-08-16 Thread houzj.f...@fujitsu.com
On Tuesday, August 2, 2022 8:00 PM Amit Kapila wrote: > On Tue, Jul 26, 2022 at 9:07 AM Amit Kapila wrote: > > > > On Tue, Jul 26, 2022 at 7:13 AM Jonathan S. Katz > wrote: > > > > > > Thanks for the example. I agree that it is fairly simple to reproduce. > > > > > > I understand that

Re: Handle infinite recursion in logical replication setup

2022-08-07 Thread vignesh C
On Fri, Jul 29, 2022 at 10:51 AM vignesh C wrote: > > On Fri, Jul 29, 2022 at 8:31 AM Peter Smith wrote: > > > > Here are some comments for the patch v40-0001: > > > > == > > > > 1. Commit message > > > > It might be better to always use 'copy_data = true' in favour of > > 'copy_data = on'

Re: Handle infinite recursion in logical replication setup

2022-08-04 Thread Amit Kapila
On Thu, Aug 4, 2022 at 6:31 PM Masahiko Sawada wrote: > > On Tue, Aug 2, 2022 at 8:59 PM Amit Kapila wrote: > > > > On Tue, Jul 26, 2022 at 9:07 AM Amit Kapila wrote: > > > > Let me try to summarize the discussion so that it is easier for others > > to follow. The work in this thread is to

Re: Handle infinite recursion in logical replication setup

2022-08-04 Thread Masahiko Sawada
On Tue, Aug 2, 2022 at 8:59 PM Amit Kapila wrote: > > On Tue, Jul 26, 2022 at 9:07 AM Amit Kapila wrote: > > > > On Tue, Jul 26, 2022 at 7:13 AM Jonathan S. Katz > > wrote: > > > > > > Thanks for the example. I agree that it is fairly simple to reproduce. > > > > > > I understand that

Re: Handle infinite recursion in logical replication setup

2022-08-02 Thread Amit Kapila
On Tue, Jul 26, 2022 at 9:07 AM Amit Kapila wrote: > > On Tue, Jul 26, 2022 at 7:13 AM Jonathan S. Katz wrote: > > > > Thanks for the example. I agree that it is fairly simple to reproduce. > > > > I understand that "copy_data = force" is meant to protect a user from > > hurting themself. I'm

RE: Handle infinite recursion in logical replication setup

2022-08-02 Thread shiy.f...@fujitsu.com
On Fri, Jul 29, 2022 1:22 PM vignesh C wrote: > > On Fri, Jul 29, 2022 at 8:31 AM Peter Smith > wrote: > > > > Thanks for the comments, the attached v41 patch has the changes for the > same. > Thanks for updating the patch. A comment for 0002 patch. In the example in section 31.11.4

Re: Handle infinite recursion in logical replication setup

2022-08-01 Thread Peter Smith
On Mon, Aug 1, 2022 at 6:52 PM Amit Kapila wrote: > > On Mon, Aug 1, 2022 at 1:32 PM Peter Smith wrote: > > > > On Mon, Aug 1, 2022 at 3:27 PM shiy.f...@fujitsu.com > > wrote: > > > > > > On Fri, Jul 29, 2022 1:22 PM vignesh C wrote: > > > > > > > > > > > > Thanks for the comments, the

Re: Handle infinite recursion in logical replication setup

2022-08-01 Thread Amit Kapila
On Mon, Aug 1, 2022 at 1:32 PM Peter Smith wrote: > > On Mon, Aug 1, 2022 at 3:27 PM shiy.f...@fujitsu.com > wrote: > > > > On Fri, Jul 29, 2022 1:22 PM vignesh C wrote: > > > > > > > > > Thanks for the comments, the attached v41 patch has the changes for the > > > same. > > > > > > > Thanks

Re: Handle infinite recursion in logical replication setup

2022-08-01 Thread Peter Smith
On Mon, Aug 1, 2022 at 3:27 PM shiy.f...@fujitsu.com wrote: > > On Fri, Jul 29, 2022 1:22 PM vignesh C wrote: > > > > > > Thanks for the comments, the attached v41 patch has the changes for the > > same. > > > > Thanks for updating the patch. > > I wonder in the case that the publisher uses PG15

RE: Handle infinite recursion in logical replication setup

2022-07-31 Thread shiy.f...@fujitsu.com
On Fri, Jul 29, 2022 1:22 PM vignesh C wrote: > > > Thanks for the comments, the attached v41 patch has the changes for the > same. > Thanks for updating the patch. I wonder in the case that the publisher uses PG15 (or before), subscriber uses PG16, should we have this check (check if

Re: Handle infinite recursion in logical replication setup

2022-07-28 Thread vignesh C
On Fri, Jul 29, 2022 at 8:31 AM Peter Smith wrote: > > Here are some comments for the patch v40-0001: > > == > > 1. Commit message > > It might be better to always use 'copy_data = true' in favour of > 'copy_data = on' just for consistency with all the docs and the error > messages. > >

Re: Handle infinite recursion in logical replication setup

2022-07-28 Thread Peter Smith
Here are some comments for the patch v40-0001: == 1. Commit message It might be better to always use 'copy_data = true' in favour of 'copy_data = on' just for consistency with all the docs and the error messages. == 2. doc/src/sgml/ref/create_subscription.sgml @@ -386,6 +401,15 @@

Re: Handle infinite recursion in logical replication setup

2022-07-28 Thread vignesh C
On Thu, Jul 28, 2022 at 11:28 AM Peter Smith wrote: > > Hi Vignesh. > > FYI the v39* patch fails to apply [1]. Can you please rebase it? > > > [1] > === Applying patches on top of PostgreSQL commit ID > 5f858dd3bebd1f3845aef2bff7f4345bfb7b74b3 === > === applying patch >

Re: Handle infinite recursion in logical replication setup

2022-07-28 Thread vignesh C
On Thu, Jul 28, 2022 at 11:28 AM Peter Smith wrote: > > Hi Vignesh. > > FYI the v39* patch fails to apply [1]. Can you please rebase it? > > > [1] > === Applying patches on top of PostgreSQL commit ID > 5f858dd3bebd1f3845aef2bff7f4345bfb7b74b3 === > === applying patch >

Re: Handle infinite recursion in logical replication setup

2022-07-27 Thread Peter Smith
Hi Vignesh. FYI the v39* patch fails to apply [1]. Can you please rebase it? [1] === Applying patches on top of PostgreSQL commit ID 5f858dd3bebd1f3845aef2bff7f4345bfb7b74b3 === === applying patch ./v39-0001-Check-and-throw-an-error-if-publication-tables-w.patch patching file

Re: Handle infinite recursion in logical replication setup

2022-07-26 Thread Amit Kapila
On Tue, Jul 26, 2022 at 10:23 AM Peter Smith wrote: > > On Tue, Jul 26, 2022 at 2:09 PM Amit Kapila wrote: > > > > > > I am not really sure how much we gain by maintaining consistency with > > slot_name because if due to this we have to change the error messages > > as well then it can create an

Re: Handle infinite recursion in logical replication setup

2022-07-26 Thread vignesh C
On Mon, Jul 25, 2022 at 12:58 PM Peter Smith wrote: > > Firstly, I have some (case-sensitivity) questions about the previous > patch which was already pushed [1]. > > Q1. create_subscription docs > > I did not understand why the docs refer to slot_name = NONE, yet the > newly added option says

Re: Handle infinite recursion in logical replication setup

2022-07-26 Thread vignesh C
On Tue, Jul 26, 2022 at 2:12 PM wangw.f...@fujitsu.com wrote: > > On Sun, Jul 24, 2022 1:28 AM vignesh C wrote: > > Added a note for the same and referred it to the conflicts section. > > > > Thanks for the comments, the attached v38 patch has the changes for the > > same. > > Thanks for your

Re: Handle infinite recursion in logical replication setup

2022-07-26 Thread vignesh C
On Tue, Jul 26, 2022 at 1:35 PM shiy.f...@fujitsu.com wrote: > > On Sun, Jul 24, 2022 1:28 AM vignesh C wrote: > > > > Added a note for the same and referred it to the conflicts section. > > > > Thanks for the comments, the attached v38 patch has the changes for the > > same. > > > > Thanks for

Re: Handle infinite recursion in logical replication setup

2022-07-26 Thread vignesh C
On Tue, Jul 26, 2022 at 7:16 AM Peter Smith wrote: > > Here are some review comments for the patch v38-0002: > > == > > - terminology > > There seemed to be an inconsistent alternation of the terms > "primaries" and "nodes"... For example "Setting replication between > two primaries" versus

Re: Handle infinite recursion in logical replication setup

2022-07-26 Thread vignesh C
On Sun, Jul 24, 2022 at 10:21 PM Jonathan S. Katz wrote: > > On 7/22/22 12:47 AM, Amit Kapila wrote: > > On Fri, Jul 22, 2022 at 1:39 AM Jonathan S. Katz > > wrote: > > >> 1. I'm concerned by calling this "Bidirectional replication" in the docs > >> that we are overstating the current

RE: Handle infinite recursion in logical replication setup

2022-07-26 Thread wangw.f...@fujitsu.com
On Sun, Jul 24, 2022 1:28 AM vignesh C wrote: > Added a note for the same and referred it to the conflicts section. > > Thanks for the comments, the attached v38 patch has the changes for the same. Thanks for your patches. Two slight comments on the below message in the 0001 patch: The error

RE: Handle infinite recursion in logical replication setup

2022-07-26 Thread shiy.f...@fujitsu.com
On Sun, Jul 24, 2022 1:28 AM vignesh C wrote: > > Added a note for the same and referred it to the conflicts section. > > Thanks for the comments, the attached v38 patch has the changes for the > same. > Thanks for updating the patch. A comment on the test in 0001 patch. +# Alter

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Peter Smith
On Tue, Jul 26, 2022 at 2:09 PM Amit Kapila wrote: > > On Tue, Jul 26, 2022 at 5:04 AM Peter Smith wrote: > > > > On Mon, Jul 25, 2022 at 7:33 PM vignesh C wrote: > > > > > > On Mon, Jul 25, 2022 at 12:58 PM Peter Smith > > > wrote: > > > > > > > > Firstly, I have some (case-sensitivity)

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Amit Kapila
On Tue, Jul 26, 2022 at 5:04 AM Peter Smith wrote: > > On Mon, Jul 25, 2022 at 7:33 PM vignesh C wrote: > > > > On Mon, Jul 25, 2022 at 12:58 PM Peter Smith wrote: > > > > > > Firstly, I have some (case-sensitivity) questions about the previous > > > patch which was already pushed [1]. > > > >

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Amit Kapila
On Tue, Jul 26, 2022 at 7:48 AM Peter Smith wrote: > > On Tue, Jul 26, 2022 at 11:43 AM Jonathan S. Katz > wrote: > > > ... > > That said, this introduces a new restriction for this particular > > scenario that doesn't exist on other scenarios. Instead, I would > > advocate we document how to

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Amit Kapila
On Tue, Jul 26, 2022 at 7:13 AM Jonathan S. Katz wrote: > > On 7/25/22 4:54 AM, vignesh C wrote: > > > > Let's take a simple case to understand why copy_data = force is > > required to replicate between two primaries for table t1 which has > > data as given below: > > > step4 - Node-2: > > Create

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Peter Smith
On Tue, Jul 26, 2022 at 11:43 AM Jonathan S. Katz wrote: > ... > That said, this introduces a new restriction for this particular > scenario that doesn't exist on other scenarios. Instead, I would > advocate we document how to correctly set up the two-way replication > scenario (which we have a

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Peter Smith
Here are some review comments for the patch v38-0002: == - terminology There seemed to be an inconsistent alternation of the terms "primaries" and "nodes"... For example "Setting replication between two primaries" versus "Adding a new node..." (instead of "Adding a new primary..."?). I

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Jonathan S. Katz
On 7/25/22 4:54 AM, vignesh C wrote: On Sun, Jul 24, 2022 at 10:21 PM Jonathan S. Katz wrote: On 7/22/22 12:47 AM, Amit Kapila wrote: On Fri, Jul 22, 2022 at 1:39 AM Jonathan S. Katz wrote: BTW, do you have any opinion on the idea of the first remaining patch where we accomplish two

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Peter Smith
On Mon, Jul 25, 2022 at 7:33 PM vignesh C wrote: > > On Mon, Jul 25, 2022 at 12:58 PM Peter Smith wrote: > > > > Firstly, I have some (case-sensitivity) questions about the previous > > patch which was already pushed [1]. > > > > Q1. create_subscription docs > > > > I did not understand why the

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Peter Smith
On Mon, Jul 25, 2022 at 6:54 PM Amit Kapila wrote: > > On Mon, Jul 25, 2022 at 12:58 PM Peter Smith wrote: > > ... > > > > Q2. parse_subscription_options > > > > Similarly, in the code (parse_subscription_options), I did not > > understand why the checks for special name values are implemented >

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread vignesh C
On Mon, Jul 25, 2022 at 2:24 PM vignesh C wrote: > > On Sun, Jul 24, 2022 at 10:21 PM Jonathan S. Katz > wrote: > > > > On 7/22/22 12:47 AM, Amit Kapila wrote: > > > On Fri, Jul 22, 2022 at 1:39 AM Jonathan S. Katz > > > wrote: > > > > >> 1. I'm concerned by calling this "Bidirectional

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread vignesh C
On Mon, Jul 25, 2022 at 12:58 PM Peter Smith wrote: > > Firstly, I have some (case-sensitivity) questions about the previous > patch which was already pushed [1]. > > Q1. create_subscription docs > > I did not understand why the docs refer to slot_name = NONE, yet the > newly added option says

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Amit Kapila
On Mon, Jul 25, 2022 at 12:58 PM Peter Smith wrote: > > Firstly, I have some (case-sensitivity) questions about the previous > patch which was already pushed [1]. > > Q1. create_subscription docs > > I did not understand why the docs refer to slot_name = NONE, yet the > newly added option says

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread vignesh C
On Sun, Jul 24, 2022 at 10:21 PM Jonathan S. Katz wrote: > > On 7/22/22 12:47 AM, Amit Kapila wrote: > > On Fri, Jul 22, 2022 at 1:39 AM Jonathan S. Katz > > wrote: > > >> 1. I'm concerned by calling this "Bidirectional replication" in the docs > >> that we are overstating the current

Re: Handle infinite recursion in logical replication setup

2022-07-25 Thread Peter Smith
Firstly, I have some (case-sensitivity) questions about the previous patch which was already pushed [1]. Q1. create_subscription docs I did not understand why the docs refer to slot_name = NONE, yet the newly added option says origin = none/any. I think that saying origin = NONE/ANY would be

Re: Handle infinite recursion in logical replication setup

2022-07-24 Thread Amit Kapila
On Sun, Jul 24, 2022 at 10:21 PM Jonathan S. Katz wrote: > > On 7/22/22 12:47 AM, Amit Kapila wrote: > > On Fri, Jul 22, 2022 at 1:39 AM Jonathan S. Katz > > wrote: > > >> 1. I'm concerned by calling this "Bidirectional replication" in the docs > >> that we are overstating the current

Re: Handle infinite recursion in logical replication setup

2022-07-24 Thread Jonathan S. Katz
On 7/22/22 12:47 AM, Amit Kapila wrote: On Fri, Jul 22, 2022 at 1:39 AM Jonathan S. Katz wrote: 1. I'm concerned by calling this "Bidirectional replication" in the docs that we are overstating the current capabilities. I think this is accentuated int he opening paragraph: ==snip==

  1   2   3   >