Re: Conflict Detection and Resolution

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Jan Wieck <jan(at)wi3ck(dot)info>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Conflict Detection and Resolution
Date: 2024-08-30 06:48:35
Message-ID: CAJpy0uDEx8TDO4nz+B=uixts7CeB6+09K_NrDvnbrUQvoe+N=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 30, 2024 at 12:13 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Wed, Aug 28, 2024 at 10:58 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > On Wed, Aug 28, 2024 at 10:30 AM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
> > >
> > >> 2)
> > >> Currently pg_dump is dumping even the default resolvers configuration.
> > >> As an example if I have not changed default configuration for say
> > >> sub1, it still dumps all:
> > >>
> > >> CREATE SUBSCRIPTION sub1 CONNECTION '..' PUBLICATION pub1 WITH (....)
> > >> CONFLICT RESOLVER (insert_exists = 'error', update_differ =
> > >> 'apply_remote', update_exists = 'error', update_missing = 'skip',
> > >> delete_differ = 'apply_remote', delete_missing = 'skip');
> > >>
> > >> I am not sure if we need to dump default resolvers. Would like to know
> > >> what others think on this.
> > >>
>
> Normally, we don't add defaults in the dumped command. For example,
> dumpSubscription won't dump the options where the default is
> unchanged. We shouldn't do it unless we have a reason for dumping
> defaults.

Agreed, we should not dump defaults. I had the same opinion.

>
> > >> 3)
> > >> Why in 002_pg_dump.pl we have default resolvers set explicitly?
> > >>
> > > In 003_pg_dump.pl, default resolvers are not set explicitly, that is the regexp to check the pg_dump generated command for creating subscriptions. This is again connected to your 2nd question.
> >
> > Okay so we may not need this change if we plan to *not *dump defaults
> > in pg_dump.
> >
> > Another point about 'defaults' is regarding insertion into the
> > pg_subscription_conflict table. We currently do insert default
> > resolvers into 'pg_subscription_conflict' even if the user has not
> > explicitly configured them.
> >
>
> I don't see any problem with it.

Yes, no problem

> BTW, if we don't do it, I think
> wherever we are referring the resolvers for a conflict, we need some
> special handling for default and non-default.

Yes, we will need special handling in such a case. Thus we shall go
with inserting defaults.

> Am I missing something?

No, I just wanted to know others' opinions, so I asked.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-08-30 06:57:57 Re: Conflict Detection and Resolution
Previous Message torikoshia 2024-08-30 06:45:55 Re: ANALYZE ONLY