diff --git a/content/en/docs/18.0/user-guides/migration/troubleshooting.md b/content/en/docs/18.0/user-guides/migration/troubleshooting.md index 78ccc854d..48523e07d 100644 --- a/content/en/docs/18.0/user-guides/migration/troubleshooting.md +++ b/content/en/docs/18.0/user-guides/migration/troubleshooting.md @@ -137,9 +137,9 @@ This can be caused by a DDL executed on the source table as by default — contr If you want the same or similar DDL to be applied on the target then you can apply that DDL on the target keyspace and then restart the workflow. For example, using the example above: ```bash -$ vtctlclient ApplySchema -- --ddl_strategy=direct --sql="alter table customer add notes varchar(100) not null" customer +$ vtctldclient ApplySchema --ddl-strategy=direct --sql="alter table customer add notes varchar(100) not null" customer -$ vtctlclient Workflow -- customer.commerce2customer start +$ vtctldclient Workflow customer.commerce2customer start ``` If the tables are not very large or the workflow has not made much progress, you can alternatively `Cancel` the current diff --git a/content/en/docs/18.0/user-guides/schema-changes/audit-and-control.md b/content/en/docs/18.0/user-guides/schema-changes/audit-and-control.md index 82a309e32..b2b3d5f9f 100644 --- a/content/en/docs/18.0/user-guides/schema-changes/audit-and-control.md +++ b/content/en/docs/18.0/user-guides/schema-changes/audit-and-control.md @@ -60,13 +60,13 @@ mysql> drop table customer; You may use `vtctl` or `vtctlclient` (the two are interchangeable for the purpose of this document) to apply schema changes. The `ApplySchema` command supports both synchronous and online schema migrations. To run an online schema migration you will supply the `--ddl_strategy` command line flag: ```shell -$ vtctlclient -- ApplySchema --ddl_strategy "vitess" --sql "ALTER TABLE demo MODIFY id bigint UNSIGNED" commerce +$ vtctldclient ApplySchema --ddl-strategy "vitess" --sql "ALTER TABLE demo MODIFY id bigint UNSIGNED" commerce a2994c92_f1d4_11ea_afa3_f875a4d24e90 ``` You my run multiple migrations withing the same `ApplySchema` command: ```shell -$ vtctlclient -- ApplySchema --ddl_strategy "vitess" --sql "ALTER TABLE demo MODIFY id bigint UNSIGNED; CREATE TABLE sample (id int PRIMARY KEY); DROP TABLE another;" commerce +$ vtctldclient ApplySchema --ddl-strategy "vitess" --sql "ALTER TABLE demo MODIFY id bigint UNSIGNED; CREATE TABLE sample (id int PRIMARY KEY); DROP TABLE another;" commerce 3091ef2a_4b87_11ec_a827_0a43f95f28a3 ``` @@ -327,19 +327,19 @@ Query OK, 1 row affected (0.01 sec) Launch a specific migration: ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration '9e8a9249_3976_11ed_9442_0a43f95f28a3' launch" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration '9e8a9249_3976_11ed_9442_0a43f95f28a3' launch" commerce ``` Or launch a specific migration on a specific shard: ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration '9e8a9249_3976_11ed_9442_0a43f95f28a3' launch vitess_shards '-40,40-80'" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration '9e8a9249_3976_11ed_9442_0a43f95f28a3' launch vitess_shards '-40,40-80'" commerce ``` Or launch all: ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration launch all" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration launch all" commerce ``` ## Completing a migration @@ -365,13 +365,13 @@ Query OK, 1 row affected (0.01 sec) Complete a specific migration: ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration '9e8a9249_3976_11ed_9442_0a43f95f28a3' complete" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration '9e8a9249_3976_11ed_9442_0a43f95f28a3' complete" commerce ``` Or complete all: ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration complete all" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration complete all" commerce ``` ## Cancelling a migration @@ -489,7 +489,7 @@ Examples for a 4-shard cluster: ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration cancel all" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration cancel all" commerce ``` Also available via `vtctlclient OnlineDDL` command: @@ -588,7 +588,7 @@ completed_timestamp: NULL ```shell -$ vtctlclient -- ApplySchema --sql "alter vitess_migration '2201058f_f266_11ea_bab4_0242c0a8b007' retry" commerce +$ vtctldclient ApplySchema --sql "alter vitess_migration '2201058f_f266_11ea_bab4_0242c0a8b007' retry" commerce ``` Also available via `vtctlclient OnlineDDL` command: @@ -657,7 +657,7 @@ Query OK, 1 row affected (0.00 sec) #### Via vtctlclient/ApplySchema -Execute via `vtctlclient -- ApplySchema --sql "..." ` like previous commands, or use `OnlineDDL` command: +Execute via `vtctldclient ApplySchema --sql "..." ` like previous commands, or use `OnlineDDL` command: ```shell @@ -727,8 +727,8 @@ Create Table: CREATE TABLE `corder` ( ### Via vtctlclient/ApplySchema -``` -$ vtctlclient -- ApplySchema --ddl_strategy "vitess" --sql "revert vitess_migration '1a689113_8d77_11eb_815f_f875a4d24e90'" commerce +```sh +$ vtctldclient ApplySchema --ddl-strategy "vitess" --sql "revert vitess_migration '1a689113_8d77_11eb_815f_f875a4d24e90'" commerce ``` ## Controlling throttling @@ -785,7 +785,7 @@ The command `show vitess_throttled_apps;` is a general purpose throttler command ### Via vtctlclient/ApplySchema -Execute via `vtctlclient -- ApplySchema --sql "..." ` like previous commands, or use `OnlineDDL` commands: +Execute via `vtctldclient ApplySchema --sql "..." ` like previous commands, or use `OnlineDDL` commands: ```shell diff --git a/content/en/docs/18.0/user-guides/schema-changes/ddl-strategies.md b/content/en/docs/18.0/user-guides/schema-changes/ddl-strategies.md index 6b18c66c8..f06fedf6c 100644 --- a/content/en/docs/18.0/user-guides/schema-changes/ddl-strategies.md +++ b/content/en/docs/18.0/user-guides/schema-changes/ddl-strategies.md @@ -23,12 +23,12 @@ You will set either `@@ddl_strategy` session variable, or `--ddl_strategy` comma #### Via vtctlclient ```shell -$ vtctlclient -- ApplySchema --ddl_strategy "vitess" --sql "ALTER TABLE demo MODIFY id bigint UNSIGNED" commerce +$ vtctldclient ApplySchema --ddl-strategy "vitess" --sql "ALTER TABLE demo MODIFY id bigint UNSIGNED" commerce a2994c92_f1d4_11ea_afa3_f875a4d24e90 ``` ```shell -$ vtctlclient -- ApplySchema --ddl_strategy "gh-ost --max-load Threads_running=200" --sql "ALTER TABLE demo add column status int" commerce +$ vtctldclient ApplySchema --ddl-strategy "gh-ost --max-load Threads_running=200" --sql "ALTER TABLE demo add column status int" commerce ``` #### Via VTGate @@ -86,7 +86,7 @@ Vitess takes care of setting up the necessary command line flags. It automatical - `set @@ddl_strategy='gh-ost --max-load Threads_running=200';` - `set @@ddl_strategy='gh-ost --max-load Threads_running=200 --critical-load Threads_running=500 --critical-load-hibernate-seconds=60 --default-retries=512';` -- `vtctlclient -- ApplySchema --ddl_strategy "gh-ost --allow-nullable-unique-key --chunk-size 200" ...` +- `vtctldclient --ddl-strategy "gh-ost --allow-nullable-unique-key --chunk-size 200" ...` **Note:** Do not override the following flags: `alter, database, table, execute, max-lag, force-table-names, serve-socket-file, hooks-path, hooks-hint-token, panic-flag-file`. Overriding any of these may cause Vitess to lose control and track of the migration, or even to migrate the wrong table. @@ -108,7 +108,7 @@ Vitess takes care of supplying the command line flags, the DSN, the username & p - `set @@ddl_strategy='pt-osc --null-to-not-null';` - `set @@ddl_strategy='pt-osc --max-load Threads_running=200';` -- `vtctlclient -- ApplySchema --ddl_strategy "pt-osc --alter-foreign-keys-method auto --chunk-size 200" ...` +- `vtctldclient ApplySchema --ddl-strategy "pt-osc --alter-foreign-keys-method auto --chunk-size 200" ...` Vitess tracks the state of the `pt-osc` migration. If it fails, Vitess makes sure to drop the migration triggers. Vitess keeps track of the migration even if the tablet itself restarts for any reason. Normally that would terminate the migration; Vitess will cleanup the triggers if so, or will happily let the migration run to completion if not. diff --git a/content/en/docs/18.0/user-guides/schema-changes/revertible-migrations.md b/content/en/docs/18.0/user-guides/schema-changes/revertible-migrations.md index f1b170769..71959cf0d 100644 --- a/content/en/docs/18.0/user-guides/schema-changes/revertible-migrations.md +++ b/content/en/docs/18.0/user-guides/schema-changes/revertible-migrations.md @@ -45,7 +45,7 @@ As of Vitess 12.0 `vtctl OnlineDDL revert` is deprecated. Use the `REVERT VITESS Via `vtctl`: ``` -$ vtctlclient -- ApplySchema --ddl_strategy "vitess" --sql "revert vitess_migration '69b17887_8a62_11eb_badd_f875a4d24e90'" commerce +$ vtctldclient ApplySchema --ddl-strategy "vitess" --sql "revert vitess_migration '69b17887_8a62_11eb_badd_f875a4d24e90'" commerce ``` Both operations return a UUID for the revert migration. The user can track the revert migration to find its state. diff --git a/content/en/docs/18.0/user-guides/schema-changes/unmanaged-schema-changes.md b/content/en/docs/18.0/user-guides/schema-changes/unmanaged-schema-changes.md index 45a8aa21f..6a5d8f151 100644 --- a/content/en/docs/18.0/user-guides/schema-changes/unmanaged-schema-changes.md +++ b/content/en/docs/18.0/user-guides/schema-changes/unmanaged-schema-changes.md @@ -23,7 +23,7 @@ CREATE TABLE `demo` ( Consider the following examples: ```shell -$ vtctlclient ApplySchema -- --sql "ALTER TABLE demo modify id bigint unsigned" commerce +$ vtctldclient ApplySchema --sql "ALTER TABLE demo modify id bigint unsigned" commerce ``` ```sql SHOW CREATE TABLE demo;