Re: Handle infinite recursion in logical replication setup
vignesh C <vignesh21@gmail.com>
From: vignesh C <vignesh21@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Peter Smith <smithpb2250@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>,
"shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-07-14T13:04:02Z
Lists: pgsql-hackers
Attachments
- v33-0001-Skip-replication-of-data-having-origin.patch (text/x-patch) patch v33-0001
- v33-0002-Check-and-throw-an-error-if-publication-tables-w.patch (text/x-patch) patch v33-0002
- v33-0003-Document-bidirectional-logical-replication-steps.patch (text/x-patch) patch v33-0003
On Thu, Jul 14, 2022 at 11:26 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Wed, Jul 13, 2022 at 4:49 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> >
> > On Tue, Jul 12, 2022 at 2:58 PM vignesh C <vignesh21@gmail.com> wrote:
> > >
> > > On Tue, Jul 12, 2022 at 9:51 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > I find one thing confusing about this patch. Basically, this has two
> > option 'local' and 'any', so I would assume that all the local server
> > changes should be covered under the 'local' but now if we set some
> > origin using 'select pg_replication_origin_session_setup('aa');' then
> > changes from that session will be ignored because it has an origin id.
> > I think actually the name is creating confusion, because by local it
> > seems like a change which originated locally and the document is also
> > specifying the same.
> >
> > + If <literal>local</literal>, the subscription will request the publisher
> > + to only send changes that originated locally. If <literal>any</literal>,
> >
> > I think if we want to keep the option local then we should look up all
> > the origin in the replication origin catalog and identify whether it
> > is a local origin id or remote origin id and based on that filter out
> > the changes.
>
> On the other hand if we are interested in receiving the changes which
> are generated without any origin then I think we should change 'local'
> to 'none' and then in future we can provide a new option which can
> send the changes generated by all the local origin? I think other
> than this the patch LGTM.
Thanks for the comment. The attached v33 patch has the changes to
specify origin as 'none' instead of 'local' which will not publish the
data having any origin.
Regards,
Vignesh
Commits
-
Improved CREATE SUBSCRIPTION message for clarity
- 1e7ca1189ccc 17.0 landed
- 842b65905046 16.0 landed
-
Fix the test case introduced by commit 8756930190.
- 032465157347 16.0 landed
-
Raise a warning if there is a possibility of data from multiple origins.
- 875693019053 16.0 landed
-
Add wait_for_subscription_sync for TAP tests.
- 0c20dd33db16 16.0 cited
-
Bump catversion for commit d8cd0c6c95c0120168df93aae095df4e0682a08a.
- 5f858dd3bebd 16.0 cited
-
Allow users to skip logical replication of data having origin.
- 366283961ac0 16.0 landed
-
Improve two comments related to a boolean DefElem's value
- 8445f5a21d40 16.0 cited
-
doc: Fix man page whitespace issues
- d7ab2a9a3c0a 15.0 cited