Re: Handle infinite recursion in logical replication setup

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: 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-04-29 11:01:41
Message-ID: CALDaNm39T59iWL7UEurF=BCHnezOBOPPLfhQTuk7BWK8AtdPgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 29, 2022 at 8:08 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Here are my review comments for the v11* patches.
>
> ======
>
> v11-0001 - no more comments. LGTM
>
> ======
>
> V11-0002
>
> 1. doc/src/sgml/logical-replication.sgml
>
> + <para>
> + Bidirectional replication is useful in creating multi master database
> + which helps in performing read/write operations from any of the nodes.
> + Setting up bidirectional logical replication between two nodes requires
> + creation of the publication in all the nodes, creating subscriptions in
> + each of the nodes that subscribes to data from all the nodes. The steps
> + to create a two-node bidirectional replication are given below:
> + </para>
>
> Wording: "creating multi master database" -> "creating a multi-master database"
> Wording: "creation of the publication in all the nodes" -> "creation
> of a publication in all the nodes".

Modified

> ~~~
>
> 2. doc/src/sgml/logical-replication.sgml
>
> > +<programlisting>
> > +node2=# CREATE SUBSCRIPTION sub_node1_node2
> > +node2=# CONNECTION 'dbname=foo host=node1 user=repuser'
> > +node2=# PUBLICATION pub_node1
> > +node2=# WITH (copy_data = off, local_only = on);
> > +CREATE SUBSCRIPTION
> > +</programlisting>
> > + </para>
> >
> > IIUC the closing </para> should be on the same line as the
> > </programlisting>. I recall there was some recent github push about
> > this sometime in the last month - maybe you can check to confirm it.
>
> Vignesh: I have seen the programlisting across multiple places and noticed
> that there is no such guideline being followed. I have not made any
> change for this comment.
>
> FYI – I found the push [1] by PeterE that I was referring to so. I
> thought we perhaps should follow this, even if not all other code is
> doing so. But you can choose.

Modified

> ~~~
>
> 3. doc/src/sgml/logical-replication.sgml
>
> + <para>
> + Create a subscription in <literal>node3</literal> to subscribe the changes
> + from <literal>node1</literal> and <literal>node2</literal>, here
> + <literal>copy_data</literal> is specified as <literal>force</literal> when
> + creating a subscription to <literal>node1</literal> so that the existing
> + table data is copied during initial sync:
> +<programlisting>
> +node3=# CREATE SUBSCRIPTION
> +node3-# sub_node3_node1 CONNECTION 'dbname=foo host=node1 user=repuser'
> +node3-# PUBLICATION pub_node1
> +node3-# WITH (copy_data = force, local_only = on);
> +CREATE SUBSCRIPTION
> +node3=# CREATE SUBSCRIPTION
> +node3-# sub_node3_node2 CONNECTION 'dbname=foo host=node2 user=repuser'
> +node3-# PUBLICATION pub_node2
> +node3-# WITH (copy_data = off, local_only = on);
> +CREATE SUBSCRIPTION
> +</programlisting>
>
> I think this part should be split into 2 separate program listings
> each for the different subscriptions. Then those descriptions can be
> described separately (e.g. why one is force and the other is not).
> Then it will also be more consistent with how you split/explained
> something similar in the previous section on this page.

Modified
The attached v12 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v12-0001-Skip-replication-of-non-local-data.patch text/x-patch 53.7 KB
v12-0002-Support-force-option-for-copy_data-check-and-thr.patch text/x-patch 47.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2022-04-29 11:42:59 Re: Skipping schema changes in publication
Previous Message Alvaro Herrera 2022-04-29 10:41:15 Re: Add WAL recovery messages with log_wal_traffic GUC (was: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display)