Support for ALTER VITESS_MIGRATION statements#7663
Support for ALTER VITESS_MIGRATION statements#7663shlomi-noach merged 31 commits intovitessio:masterfrom
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>
…or RETRY alter type 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>
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>
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>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
|
Documentation to follow |
|
This PR also refactors |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
|
@systay points out that this PR has commits from merged PRs. It seems to be a rebase gone wrong. However, code-wise and diff-wise there doesn't seem to be a risk here. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
|
Confused about They're consistently failing after |
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>
|
Kind request for review 🙏 (reminder: this PR extends #7656) |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
The old test had hardcoded values for the expected sizes of internal data structures. This makes for very brittle tests whenever we change the AST or introduce new query types. Instead of checking for the exact sizes of the data structures, check that they're being stored and whether they're larger than than an empty plan. Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
|
Sheesh. GitHub Actions is having another bad day. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
| ) | ||
|
|
||
| func buildRevertPlan(query string, stmt *sqlparser.RevertMigration, vschema ContextVSchema) (engine.Primitive, error) { | ||
| func buildAlterMigrationPlan(query string, stmt *sqlparser.AlterMigration, vschema ContextVSchema) (engine.Primitive, error) { |
There was a problem hiding this comment.
nit: why ask for stmt and then not use it?
There was a problem hiding this comment.
Nice catch! Removed.
| e.migrationMutex.Lock() | ||
| defer e.migrationMutex.Unlock() | ||
| parsed := sqlparser.BuildParsedQuery(sqlRetryMigration, ":tablet", whereExpr) | ||
| parsed := sqlparser.BuildParsedQuery(sqlRetryMigrationWhere, ":tablet", whereExpr) |
There was a problem hiding this comment.
just noticed that three lines down, on line 2247, we are never checking err from parsed.GenerateQuery
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
…terface-alter Signed-off-by: Andres Taylor <andres@planetscale.com>
Description
This PR introduces the following queries:
ALTER VITESS_MIGRATION '8c096d5e_81c0_11eb_a8d2_f875a4d24e90' RETRYALTER VITESS_MIGRATION '8c096d5e_81c0_11eb_a8d2_f875a4d24e90' CANCELALTER VITESS_MIGRATION CANCEL ALLThe above map to these
vtctlcommands, respectively:vtctl OnlineDDL <keyspace> retry 8c096d5e_81c0_11eb_a8d2_f875a4d24e90vtctl OnlineDDL <keyspace> cancel 8c096d5e_81c0_11eb_a8d2_f875a4d24e90vtctl OnlineDDL <keyspace> cancel allAlso, reserved but not implemented yet:
ALTER VITESS_MIGRATION '8c096d5e_81c0_11eb_a8d2_f875a4d24e90' COMPLETEReturned result set for these queries is always empty, but
AffectedRowsindicates how many migrations were actually affected by the command.The various
endtoend/onlineddltests now use these queries.Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: