RE: Handle infinite recursion in logical replication setup - Mailing list pgsql-hackers

From shiy.fnst@fujitsu.com
Subject RE: Handle infinite recursion in logical replication setup
Date
Msg-id OSZPR01MB631038A493A86EC83BEC17FCFDD89@OSZPR01MB6310.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Handle infinite recursion in logical replication setup  (vignesh C <vignesh21@gmail.com>)
Responses Re: Handle infinite recursion in logical replication setup  (Peter Smith <smithpb2250@gmail.com>)
Re: Handle infinite recursion in logical replication setup  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
On Wed, May 25, 2022 7:55 PM vignesh C <vignesh21@gmail.com> wrote:
> 
> The attached v16 patch has the changes for the same.
> 

Thanks for updating the patch.

Some comments for the document in 0002 patch.

1.
+   <para>
+    Lock the required tables in <literal>node1</literal> and
+    <literal>node2</literal> till the setup is completed.
+   </para>
+
+   <para>
+    Create a publication in <literal>node1</literal>:
+<programlisting>
+node1=# CREATE PUBLICATION pub_node1 FOR TABLE t1;
+CREATE PUBLICATION
+</programlisting></para>

If the table is locked in the very beginning, we will not be able to create the
publication (because the locks have conflict). Maybe we should switch the order
of creating publication and locking tables here.

2.
In the case of "Adding a new node when data is present in the new node", we need
to truncate table t1 in node3, but the truncate operation would be blocked
because the table has be locked before. Maybe we need some changes for it.

Regards,
Shi yu


pgsql-hackers by date:

Previous
From: "Tharakan, Robins"
Date:
Subject: Allow makeaclitem() to accept multiple privileges
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: bogus: logical replication rows/cols combinations