2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
1.01k stars 153 forks source link

Truncate CASCADE brings pglogical subscriber down #381

Open sreejithvelath opened 2 years ago

sreejithvelath commented 2 years ago

I have two source databases and one target database.

I have setup pglogical replication between the two source dbs to the target db

source db1 -> replicates few tables to -> target db1 source db2 -> replicates few tables to -> target db1

After the initial setup, the subscription status is shown replicating and entire data is replicated. The replication is working fine from both databases.

However, when I perform a TRUNCATE CASCADE in one of the parent table in source db1 , the subscription status is changed from "replicating" to "down".

Then, if I drop the subscriber node and recreates it, the subscription will again start replicating.

Please let me know if pglogical has any know issue when TRANCATE CASCADE is performed at provider node.

gowgopal83 commented 1 year ago

We have disabled the replication and tried to drop the table with cascade which dropped the replication. Any help on this ?

drop table table1;
ERROR:  cannot drop table table1 because other objects depend on it
DETAIL:  table table1 membership in replication set replication_set depends on table table1
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
nubi=# drop table table1 CASCADE;
NOTICE:  drop cascades to table table1 membership in the replication set replication_set
DROP TABLE