Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
Date
Msg-id CAA4eK1JPXPKskfB=VUfxW2bxU4w7mpgC-Las9GiHi5O8GiRC4A@mail.gmail.com
Whole thread Raw
In response to Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION  (Japin Li <japinli@hotmail.com>)
Responses Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
RE: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
List pgsql-hackers
On Fri, Aug 6, 2021 at 9:57 PM Japin Li <japinli@hotmail.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.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Alias collision in `refresh materialized view concurrently`
Next
From: Amit Kapila
Date:
Subject: Re: Diagnostic comment in LogicalIncreaseXminForSlot