-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: mark index as GCed if table has been GCed in legacy gc path
Previously, if a table is GCed before an index is GCed by a TRUNCATE TABLE gc job, the TRUNCATE TABLE gc job can be stuck in running status because the table descriptor is missing. This is problematic because these jobs will never succeed and doing nothing. This commit marks the indexes as GCed if the descriptor cannot be found assuming that the table has been GCed. Also, table GC should have GCed all the indexes. Note that this only affect the legacy GC path. Epic: None Release note (bug fix): This commit fixes a bug where TRUNCATE TABLE gc job can be stuck in running status if the table descriptor has been GCed. It was because TRUNCATE TABLE actually creates new empty indexes, then replaces and drops the old indexes. The dropped indexes data are deleted and GCed within the TRUNCATE TABLE gc job which needed to see the table descriptor to make progress. But, if the table data has been GCed, the TRUNCATE TABLE gc job couldn't make progress. This patch makes it able to handle the missing descriptor edge case and let the TRUNCATE TABLE gc job succeed.
- Loading branch information
1 parent
0745cd4
commit a22ef53
Showing
3 changed files
with
84 additions
and
0 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