-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Summary: When a YSQL table is dropped it will now properly clean it up from xCluster. On the target cluster when the YSQL table is dropped, it will be removed from all the` UniverseReplicationGroups`. As part of this step we delete the stream on the source cluster. On the source cluster when the YSQL table is dropped, it is hidden and kept until all its xCluster streams are dropped. This ensures data gets replicated to target clusters that are lagging behind. When the target table is dropped it will delete the source stream which will then delete the source tablets, and table. Also, the source streams belonging to dropped tables are automatically deleted after `FLAGS_cdc_wal_retention_time_secs`. This will cover the case when the two clusters are network partitioned, or the target cluster is down. When the sourcer cluster xCluster stream is deleted as part of its cleanup we now delete it from the xCluster Outbound ReplicationGroups. Drop of YCQL tables under xCluster replication are blocked. Drop of YSQL dbs with tables under xCluster replication are blocked. Moved all code related to removing tables from xCluster out of catalog manager. `RemoveTablesFromReplication` has been renamed to `RemoveTablesFromReplicationGroup` and moved to `xcluster_replication_group.cc`. `DeleteXReplStatesForIndexTables` has been moved to `XClusterTargetManager::RemoveDroppedTablesOnConsumer`. Added a Background task in `XClusterTargetManager` to `RemoveDroppedTablesFromReplication` Fixes #16971 Fixes #20206 Jira: DB-6295, DB-9160 Test Plan: XClusterYsqlTest, DropTableOnConsumerThenProducer XClusterYsqlTest, ConsumerMasterRestartAfterTableDrop XClusterYsqlTest, DropTableOnProducerThenConsumer XClusterYsqlTest, ProducerMasterRestartAfterTableDrop XClusterYsqlTest, DropTableWithWorkload XClusterYsqlTest, DropTableOnProducerOnly XClusterDBScopedTest, DropTableOnProducerThenConsumer Reviewers: jhe, slingam, xCluster Reviewed By: slingam Subscribers: ybase, bogdan Differential Revision: https://phorge.dev.yugabyte.com/D33051
- Loading branch information
Showing
27 changed files
with
1,141 additions
and
570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.