Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
Japin Li <japinli@hotmail.com>
From: Li Japin <japinli@hotmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-07T13:19:49Z
Lists: pgsql-hackers
> On Aug 7, 2021, at 1:35 PM, Amit Kapila <amit.kapila16@gmail.com> wrote: > > 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. > I prefer to refresh all PUBLICATIONS for both ADD and DROP operations, I think this is more consistent and makes the code simple. -- Best regards Japin Li
Commits
-
Fix Alter Subscription's Add/Drop Publication behavior.
- 5cfcd46e9d29 14.0 landed
- 1046a69b3087 15.0 landed
-
ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
- 82ed7748b710 14.0 cited