-
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.
[#12476] xCluster,TabletSplitting: Handle parent tablet deletion for …
…xCluster related tablets Summary: *This is a fixed version of D17313 / commit 4b0f239* Previously, parent tablets retained by xCluster were being retained for as long as their wal retention time, and also weren't being cleaned up from the cdc_state table. This could lead to metrics being stuck on high values, and stale old entries being left in cdc_state. Adding in a new map `retained_by_xcluster_` to keep track of parent tablets that are hidden but that are still being replicated by xCluster. Tablets in this map won't be deleted by the hidden tablet deleting bg task. Tablets are added to this map when they are hidden for the first time. Also adding in a bg task to check the status of tablets in this mapping and remove them if required. This will check the cdc_state entries for the children tablets and ensure that they are present and being polled, at which point the parent is no longer needed. This background thread will remove these parent tablets from `retained_by_xcluster_` which will then lead to the hidden tablet deleting bg task to clean up and actually delete the tablet. To determine when the children tablets are being polled, changing the initial rows that we insert for new children tablets into cdc_state. Will now be setting the initial timestamp to null for these children tablets, so that we can tell that this is a new tablet that we have yet to start replicating yet. Also discovered an issue with bootstrap + splitting: if we have tablet splits after having run BootstrapCdcProducer, then during SetupUniverseReplication, we use the current active tablets to start polling from. This complicates how we handle processing of the bootstrap checkpoint, and cleanup of the original tablets that were around for the bootstrap. For now, disabling tablet splits for tablets that are part of a bootstrapping state (state = INITIATED). Note that this does mean that if users bootstrap a stream but don't setup replication for it, then tablet splits won't happen until this stream is properly deleted (via DeleteCdcStream). init atomic bool Test Plan: ``` ybd --cxx-test integration-tests_xcluster-tablet-split-itest --gtest_filter XClusterExternalTabletSplitITest.MasterFailoverDuringConsumerPostSplitOps ybd --cxx-test integration-tests_xcluster-tablet-split-itest --gtest_filter XClusterExternalTabletSplitITest.MasterFailoverDuringProducerPostSplitOps ybd --cxx-test integration-tests_xcluster-tablet-split-itest ``` Reviewers: nicolas, rahuldesirazu Reviewed By: rahuldesirazu Subscribers: zyu, mbautin, bogdan, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D17795
- Loading branch information
Showing
13 changed files
with
513 additions
and
128 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.