From 306d3871f86c1052f290cf823825c8defec0b59c Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:22:23 +0200 Subject: [PATCH 1/3] vtctl ApplySchema accepts 'ALTER VITESS_MIGRATION...' statements Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/schemamanager/tablet_executor.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/go/vt/schemamanager/tablet_executor.go b/go/vt/schemamanager/tablet_executor.go index 15712f9383a..7c7b6985db6 100644 --- a/go/vt/schemamanager/tablet_executor.go +++ b/go/vt/schemamanager/tablet_executor.go @@ -249,13 +249,9 @@ func (exec *TabletExecutor) executeSQL(ctx context.Context, sql string, execResu return err } for _, onlineDDL := range onlineDDLs { - if exec.ddlStrategySetting.IsSkipTopo() { - exec.executeOnAllTablets(ctx, execResult, onlineDDL.SQL, true) - if len(execResult.SuccessShards) > 0 { - exec.wr.Logger().Printf("%s\n", onlineDDL.UUID) - } - } else { - exec.executeOnlineDDL(ctx, execResult, onlineDDL) + exec.executeOnAllTablets(ctx, execResult, onlineDDL.SQL, true) + if len(execResult.SuccessShards) > 0 { + exec.wr.Logger().Printf("%s\n", onlineDDL.UUID) } } return nil @@ -267,15 +263,13 @@ func (exec *TabletExecutor) executeSQL(ctx context.Context, sql string, execResu execResult.ExecutorErr = err.Error() return err } - if exec.ddlStrategySetting.IsSkipTopo() { - exec.executeOnAllTablets(ctx, execResult, onlineDDL.SQL, true) - exec.wr.Logger().Printf("%s\n", onlineDDL.UUID) - } else { - exec.executeOnlineDDL(ctx, execResult, onlineDDL) - } + exec.executeOnAllTablets(ctx, execResult, onlineDDL.SQL, true) + exec.wr.Logger().Printf("%s\n", onlineDDL.UUID) + return nil + case *sqlparser.AlterMigration: + exec.executeOnAllTablets(ctx, execResult, sql, true) return nil } - exec.wr.Logger().Infof("Received DDL request. strategy=%+v", schema.DDLStrategyDirect) exec.executeOnAllTablets(ctx, execResult, sql, false) return nil } From d316636f4cd276951bd73c07784786f241a25713 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:33:12 +0200 Subject: [PATCH 2/3] release notes Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- doc/releasenotes/13_0_0_summary.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/releasenotes/13_0_0_summary.md b/doc/releasenotes/13_0_0_summary.md index f7a637d1606..dd8c2a4435c 100644 --- a/doc/releasenotes/13_0_0_summary.md +++ b/doc/releasenotes/13_0_0_summary.md @@ -47,6 +47,14 @@ This command indicates that a migration executed with `-postpone-completion` is - For running `ALTER`s (`online` and `gh-ost`) which are only partly through the migration: they will cut-over automatically when they complete their work, as if `-postpone-completion` wasn't indicated - For queued `CREATE` and `DROP` migrations: "unblock" them from being scheduled. They'll be scheduled at the scheduler's discretion. there is no guarantee that they will be scheduled to run immediately. +### vtctl ApplySchema: ALTER VITESS_MIGRATION + +`vtctl ApplySchema` now supports `ALTER VITESS_MIGRATION ...` statements. Example: + +```shell +$ vtctl ApplySchema -skip_preflight -sql "alter vitess_migration '9748c3b7_7fdb_11eb_ac2c_f875a4d24e90' complete" commerce +``` + ## Incompatible Changes ## Deprecations From cc86d887619e9ddc83d7b6b91496a60703675bef Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 1 Dec 2021 07:21:10 +0200 Subject: [PATCH 3/3] restore code errornously removed Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/schemamanager/tablet_executor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/go/vt/schemamanager/tablet_executor.go b/go/vt/schemamanager/tablet_executor.go index 7c7b6985db6..53b051af145 100644 --- a/go/vt/schemamanager/tablet_executor.go +++ b/go/vt/schemamanager/tablet_executor.go @@ -270,6 +270,7 @@ func (exec *TabletExecutor) executeSQL(ctx context.Context, sql string, execResu exec.executeOnAllTablets(ctx, execResult, sql, true) return nil } + exec.wr.Logger().Infof("Received DDL request. strategy=%+v", schema.DDLStrategyDirect) exec.executeOnAllTablets(ctx, execResult, sql, false) return nil }