RE: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Japin Li <japinli(at)hotmail(dot)com>
Subject: RE: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
Date: 2021-08-07 13:23:11
Message-ID: OS0PR01MB57160E1438C155D7FC15C01294F49@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 7, 2021 1:36 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Fri, Aug 6, 2021 at 9:57 PM Japin Li <japinli(at)hotmail(dot)com> wrote:
> >
> > >
> > > Hmm yes, it cannot cover all cases. I had somehow misunderstood that
> > > the subscriber knows which relations are associated with which
> > > publications. Given that the subscriber doesn’t know which relations
> > > are associated with which publications (and the set of subscribed
> > > relations on the subscriber becomes out of date once the publication
> > > is updated), I think it's impossible to achieve that DROP
> > > PUBLICATION drops relations that are associated with only the
> > > publication being dropped.
> > >
> > >> Do we have better ideas to fix or shall we just say that we will
> > >> refresh based on whatever current set of relations are present in
> > >> publication to be dropped?
> > >
> > > I don't have better ideas. It seems to me that it's prudent that we
> > > accept the approach in v3 patch and refresh all publications in DROP
> > > PUBLICATION cases.
> > >
> >
> > Maybe refreshing all publications in PUBLICATION cases is simple way
> > to fix the problem.
> >
>
> Do you mean to say that do it for both Add and Drop or just for Drop?
> Actually, doing it both will make the behavior consistent but doing it just for
> Drop might be preferable by some users. I think it is better to be consistent here
> but I am fine if you and others feel it is better to refresh all publications only in
> Drop case.

Personally, I also think it will be better to make the behavior consistent.
Attach the new version patch make both ADD and DROP behave the same as SET PUBLICATION
which refresh all the publications.

Best regards,
houzj

Attachment Content-Type Size
v4-0001-fix-ALTER-SUBSCRIPTION-ADD-DROP-PUBLICATION.patch application/octet-stream 8.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Platon Pronko 2021-08-07 14:56:22 Re: very long record lines in expanded psql output
Previous Message Li Japin 2021-08-07 13:19:49 Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION