-
Notifications
You must be signed in to change notification settings - Fork 2k
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: ready_to_complete hint column #9813
Online DDL: ready_to_complete hint column #9813
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>
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.
Looks like a pretty straightforward way to solve this issue. One small question and found a typo 😄.
"-online_ddl_check_interval", "3s", | ||
"-schema_change_check_interval", "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.
Doesn't matter, but any reason this order of arguments was changed?
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.
Bedtime story: it turns out the onlineddl_ghost
endtoend tests have not been running in a while. There was an exception thrown in this old TestMain
function that was not caught (in itself something to investigate). What I did now was to copy+paste a brand new TestMain
function from onlineddl_vrepl
tests, which works.
Having said that, I'll reorder the arguments just to keep this PR cleaner.
go/vt/vttablet/onlineddl/executor.go
Outdated
if ddlAction == sqlparser.AlterStr || !postponeCompletion { | ||
// Any non-postponed migration can be scheduled | ||
// postponed ALTER can be scheduled | ||
// We only schedule a single migration i nthe execution of this function |
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.
Typo here, i nthe
instead of in the
.
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.
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>
Description
This PR adds
ready_to_complete
column in_vt.schema_migrations
which is then visible inSHOW VITESS_MIGRATIONS ...
output.The use case is intended for postponed migrations (although it provides visibility for non-postponed migrations as well): if a migration is postponed, the user wants to know "is now a good time to cut-over" ie run a
ALTER VITESS_MIGRATION ... COMPLETE
and expect a near-immediate cut-over.ready_to_complete
is a boolean (values0
or1
) that indicates that the migration is generally capable of cutting over. Specifically:CREATE
andDROP
migrations will always exhibit the value of1
(immediately or shortly after submission). Note that this is true even if the migrations are stillqueued
. Once they exhibit1
, they stay with1
.vitess
ALTER
migrations will indicate1
when row-copy is complete and vplayer's lag is generally good. this value can drop back to0
when the migration is postponed and vplayer happens to accumulate lag. Once vplayer is caught up again, it will flip back to1
.REVERT
of any of the above behaves similarly: aCREATE
REVERT
immediately exhibits the value of1
; anALTER
'sREVERT
exhibits1
when vplayer's lag is good and0
when vplayer accumulates laggh-ost
ALTER
migrations indicate1
when entering postponed state, and does not have lag indication. It is only applicable topostponed-completion
migrations.Note that all changes to
onSchemaMigrationStatus
are for supportinggh-ost
by adding a hint column togh-ost
callback API; it's not the important part of this PR.Related Issue(s)
Tracking: #6926
Checklist