-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Online DDL: ALTER VITESS_MIGRATION CLEANUP ALL
#16314
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
Online DDL: ALTER VITESS_MIGRATION CLEANUP ALL
#16314
Conversation
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16314 +/- ##
==========================================
+ Coverage 68.63% 68.64% +0.01%
==========================================
Files 1550 1550
Lines 199443 199458 +15
==========================================
+ Hits 136881 136913 +32
+ Misses 62562 62545 -17 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
if row["cleanup_timestamp"].IsNull() { | ||
needCleanup++ | ||
} else { | ||
cleanedUp++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They've only been marked as ready for cleanup. They haven't yet been cleaned up, right? I'm assuming that we already have tests that cover the actual cleanup work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, both correct!
require.NotNil(t, row) | ||
|
||
artifacts = textutil.SplitDelimitedList(row.AsString("artifacts", "")) | ||
assert.Len(t, artifacts, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, but IMO this should be require.Len as you would then panic in the line below if it has no elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Fixed.
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Description
This PR implements:
ALTER VITESS_MIGRATION CLEANUP ALL
vtctldclient OnlineDDL cleanup <keyspace> all
Migrations that are in
complete/failed/cancelled
state, and which have not been cleaned up, are marked for cleanup. This command technically affects all historical migrations, although realistically Vitess routinely cleans up migrations after a day or so (depending on configuration). As a reminder,CLEANUP
is not strictly required thanks to that automation. It's just in a way to ask for earlier removal of the artifacts tables, which is beneficial if those are large and consume disk space that is otherwise needed right away.Related Issue(s)
ALTER VITESS_MIGRATION CLEANUP ALL
command #16313Checklist
Deployment Notes