-
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.
[#22159] Docdb: Fix hide table workflow to avoid getting stuck in HID…
…ING state Summary: Currently, we have a gap in our hide DocDB table workflow where a table can get stuck indefinitely in HIDING state. Here is a simplified version of how hide table works: 1- Change the state of the `SysTableEntry` to `HIDING` and upsert in sys.catalog. 2- Commit the in-memory state of TableInfo to `HIDING`. 3- Hide the tablets of the table. 3.1- Mark the tablets' state as hidden. 3.2- Send async DeleteTablet requests to tservers. The table state transition from HIDING to HIDDEN happens when condition c1 is fulfilled: the table has no more tasks attached and all its tablets are in hidden state. This check currently happens in two places: - Happy path: The check of c1 happens on the async response of every delete tablet task. More specifically: `CatalogManager::NotifyTabletDeleteFinished`. - Unhappy path: In the background thread, we regularly check c1 to see if tables in `HIDING` state can be `HIDDEN`. If the master leader crashes anytime after 1 and before 3.1 completes, the table will be indefinitely stuck in HIDING state. The diff fixes the issue by filling the gaps in hide workflow and following what we do today for delete table. After the fix: 1- When the new master leader reloads sys.catalog, if the table is in `HIDING` state and its tablets are not in `HIDDEN` state, we mark the tablets as `HIDDEN` on master. More specifically, we add a post sys.catalog loading task which sets the `hide_hybrid_time` to some value and sets the retained by schedules info. 2- (Already implemented) When tservers heartbeat with a tablet that is marked `HIDDEN` on master, then master will send an async hide tablet request to the tserver to hide the tablet. The fix guarantees that the table will never be stuck in HIDING state in case the master crashes while hiding the table. Jira: DB-11088 Test Plan: ./yb_build.sh --cxx_test yb-admin-snapshot-schedule-test --gtest-filter YbAdminSnapshotScheduleTest.DroppedTableMarkedHiddenAfterFailover Reviewers: hsunder, zdrudi, xCluster Reviewed By: zdrudi Subscribers: svc_phabricator, asrivastava, ybase, slingam Differential Revision: https://phorge.dev.yugabyte.com/D39677
- Loading branch information
1 parent
edcaee5
commit a308602
Showing
9 changed files
with
124 additions
and
22 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
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
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