Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed DROP TABLE #6719

Merged
merged 25 commits into from
Oct 6, 2020
Merged

Conversation

shlomi-noach
Copy link
Contributor

@shlomi-noach shlomi-noach commented Sep 14, 2020

Tracking issue: #6689

Implementing a TableGC (garbage collector) component as part of TabletServer, which periodically checks for tables in various table-drop states, transitions the tables between those states, purges data from the tables, or drops them altogether.

At this time this PR is not concerned with user facing DROP statements.

@shlomi-noach shlomi-noach marked this pull request as ready for review September 17, 2020 07:01
@shlomi-noach
Copy link
Contributor Author

This PR is now ready for review. Still TODO:

  • endtoend tests
  • accompanying documentation

@shlomi-noach shlomi-noach changed the title WIP: Managed DROP TABLE Managed DROP TABLE Sep 17, 2020
@shlomi-noach
Copy link
Contributor Author

Please note this PR requires, and is based on, #6668 . It is best if we first merge #6668. Reviewing this PR will become easier.

@shlomi-noach
Copy link
Contributor Author

This PR implements most of the DROP TABLE logic in #6689 : it runs the table lifecycle behind the scenes, down to dropping the table. The only part it does not implement is the user facing DROP IN '24h' TABLE my_table syntax. This will be taken care of by a followup PR.

This PR is enough to run table garbage collection, if only the user/app know how to RENAME their table into the correct magic form. That's easy to do if you use the mechanisms go/vt/schema. And this is exactly what #6547 (or one of its followups) will do at the end of migration, for the artifact tables.

@shlomi-noach
Copy link
Contributor Author

endtoend tests now added

Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
@shlomi-noach
Copy link
Contributor Author

This PR is in good shape the way I see it. It works through a table's lifecycle to eventually drop it; it only works on tables with "magic" names like _vt_HOLD_6ace8bcef73211ea87e9f875a4d24e90_20200915120410.

It does not offer a DROP TABLE syntax -- that's for a different PR.

So, this PR only introduces a new behavior for very special tables, which will be immediately put to use by #6547 .

@shlomi-noach shlomi-noach requested a review from deepthi October 1, 2020 10:21
Signed-off-by: Shlomi Noach <[email protected]>
@shlomi-noach
Copy link
Contributor Author

I'm ready to have this PR reviewed and merged.

Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.
We can merge after the conflicts are resolved and tests pass.

@shlomi-noach
Copy link
Contributor Author

conflicts resolved, tests pass. Per review, I'm now merging (!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants