From 4afbd5f69f6323ff5258e8a7ca2100c61ef43979 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 10 Oct 2021 15:21:27 +0300 Subject: [PATCH 1/3] OnlineDDL in v12: remove legacy code deprecated in earlier version Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vtctl/vtctl.go | 79 -------------------------------------------- 1 file changed, 79 deletions(-) diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 2e75d731177..87aece95384 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -482,14 +482,6 @@ var commands = []commandGroup{ "Outputs a JSON structure that contains information about the ShardReplication."}, }, }, - { - "Workflow", []command{ - {"VExec", commandVExec, - " --dry-run", - "Runs query on all tablets in workflow. Example: VExec merchant.morders \"update _vt.vreplication set Status='Running'\"", - }, - }, - }, { "Workflow", []command{ {"Workflow", commandWorkflow, @@ -3017,38 +3009,6 @@ func commandOnlineDDL(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag } query = `update _vt.schema_migrations set migration_status='cancel-all'` } - case "revert": - { - deprecationMessage := `OnlineDDL 'revert' command will be deprecated in version v12. Use "REVERT VITESS_MIGRATION ''" SQL command` - log.Warningf(deprecationMessage) - - if arg == "" { - return fmt.Errorf("UUID required") - } - uuid = arg - contextUUID, err := schema.CreateUUID() - if err != nil { - return err - } - requestContext := fmt.Sprintf("vtctl:%s", contextUUID) - - ddlStrategySetting := schema.NewDDLStrategySetting(schema.DDLStrategyOnline, "") - onlineDDL, err := schema.NewOnlineDDL(keyspace, "", fmt.Sprintf("revert %s", uuid), ddlStrategySetting, requestContext) - if err != nil { - return err - } - conn, err := wr.TopoServer().ConnForCell(ctx, topo.GlobalCell) - if err != nil { - return err - } - err = onlineDDL.WriteTopo(ctx, conn, schema.MigrationRequestsPath()) - if err != nil { - return err - } - wr.Logger().Infof("UUID=%+v", onlineDDL.UUID) - wr.Logger().Printf("%s\n", onlineDDL.UUID) - return nil - } default: return fmt.Errorf("Unknown OnlineDDL command: %s", command) } @@ -3542,45 +3502,6 @@ func commandHelp(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.Flag return nil } -func commandVExec(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { - deprecationMessage := `VExec command will be deprecated in version v12. For Online DDL control, use "vtctl OnlineDDL" commands or SQL syntax` - log.Warningf(deprecationMessage) - - json := subFlags.Bool("json", false, "Output JSON instead of human-readable table") - dryRun := subFlags.Bool("dry_run", false, "Does a dry run of VExec and only reports the final query and list of tablets on which it will be applied") - if err := subFlags.Parse(args); err != nil { - return err - } - if subFlags.NArg() != 2 { - return fmt.Errorf("usage: VExec --dry-run keyspace.workflow \"\"") - } - keyspace, workflow, err := splitKeyspaceWorkflow(subFlags.Arg(0)) - if err != nil { - return err - } - _, err = wr.TopoServer().GetKeyspace(ctx, keyspace) - if err != nil { - wr.Logger().Errorf("keyspace %s not found", keyspace) - } - query := subFlags.Arg(1) - - qr, err := wr.VExecResult(ctx, workflow, keyspace, query, *dryRun) - if err != nil { - return err - } - if *dryRun { - return nil - } - if qr == nil { - wr.Logger().Printf("no result returned\n") - } - if *json { - return printJSON(wr.Logger(), qr) - } - printQueryResult(loggerWriter{wr.Logger()}, qr) - return nil -} - func commandWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { dryRun := subFlags.Bool("dry_run", false, "Does a dry run of Workflow and only reports the final query and list of tablets on which the operation will be applied") if err := subFlags.Parse(args); err != nil { From 2d7b9bed957e92fbf1615110524bf2c29bb1e3b7 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 12 Oct 2021 10:09:18 +0300 Subject: [PATCH 2/3] Adding release notes Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- doc/releasenotes/12_0_0_summary.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/releasenotes/12_0_0_summary.md b/doc/releasenotes/12_0_0_summary.md index ea7d4199de7..8a01147da29 100644 --- a/doc/releasenotes/12_0_0_summary.md +++ b/doc/releasenotes/12_0_0_summary.md @@ -26,4 +26,10 @@ zone1-0000000100 sourcekeyspace 0 primary 192.168.0.134:15100 192.168.0.134:1710 zone1-0000000101 sourcekeyspace 0 rdonly 192.168.0.134:15101 192.168.0.134:17101 [] zone1-0000000102 sourcekeyspace 0 replica 192.168.0.134:15102 192.168.0.134:17102 [] zone1-0000000103 sourcekeyspace 0 rdonly 192.168.0.134:15103 192.168.0.134:17103 [] -``` \ No newline at end of file +``` + +## Deprecations + +The command `vtctl VExec` is deprecated and removed. All Online DDL commands should run through `vtctl OnlineDDL`. + +The command `vtctl OnlineDDL revert` is deprecated. Use `REVERT VITESS_MIGRATION '...'` SQL command either via `vtctl ApplySchema` or via `vtgate`. From d8ab31631c4e8f426dd5120709376448ae517945 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 20 Oct 2021 21:18:40 +0300 Subject: [PATCH 3/3] gofmt Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vtctl/vtctl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 00f20d07cd9..c8d16f07c02 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -778,7 +778,7 @@ var commands = []commandGroup{ method: commandWorkflow, params: " --dry-run", help: "Start/Stop/Delete/Show/ListAll/Tags Workflow on all target tablets in workflow. Example: Workflow merchant.morders Start", - }, + }, }, }, }