RE: Added schema level support for publication.

From: "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ajin Cherian <itsajin(at)gmail(dot)com>
Subject: RE: Added schema level support for publication.
Date: 2021-06-29 03:25:18
Message-ID: OS0PR01MB61134B20314DE45795DD384CFB029@OS0PR01MB6113.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, June 25, 2021 2:25 AM vignesh C <vignesh21(at)gmail(dot)com>wrote:
>
> Thanks for reporting these warnings, I have fixed this in the v8 patch
> attached at [1].
> [1] - https://www.postgresql.org/message-
> id/CALDaNm044P_cds1OxZvFse5rE_qQfhbUg5MdtMgsa7t_bZGJdw%40mail.
> gmail.com
>

Thanks for your patch. The warnings are fixed.

But I found an issue while using your V8 patch, which is similar to [1]. The case is as below:
Drop a schema from publication and refresh publication at subscriber, then insert into publisher table, the inserts still replicated to subscriber. The expect result is that the data is no longer replicated.

For example:
------publisher------
create schema s1;
create table s1.t1 (a int primary key);
create publication pub for schema s1;

------subscriber------
create schema s1;
create table s1.t1 (a int primary key);
create subscription sub connection 'dbname=postgres port=5432' publication pub;

------publisher------
insert into s1.t1 values (1);

------subscriber------
postgres=# select * from s1.t1;
a
---
1
(1 row)

------publisher------
alter publication pub drop schema s1;
insert into s1.t1 values (2);

------subscriber------
postgres=# select * from s1.t1;
a
---
1
2
(2 rows)

The similar issue [1] (related to "ALTER PUBLICATION .. DROP TABLE") was fixed by modifying in rel_sync_cache_publication_cb callback, which is related to PUBLICATIONRELMAP syscache. In my case, I think it used PUBLICATIONSCHEMAMAP syscache, and no callback was registered for it. Should we register a callback for it or fix it in other ways?

[1]https://www.postgresql.org/message-id/flat/CALj2ACV%2B0UFpcZs5czYgBpujM9p0Hg1qdOZai_43OU7bqHU_xw%40mail.gmail.com

Regards
Tang

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-06-29 03:41:43 Re: Different compression methods for FPI
Previous Message Amit Kapila 2021-06-29 02:49:35 Re: missing GRANT on pg_subscription columns