Skip to content

Commit

Permalink
vtctlclient -> vtctldclient
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Aug 8, 2023
1 parent c849e22 commit b480ac6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions content/en/docs/18.0/user-guides/migration/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -657,7 +657,7 @@ Query OK, 1 row affected (0.00 sec)

#### Via vtctlclient/ApplySchema

Execute via `vtctlclient -- ApplySchema --sql "..." <keyspace>` like previous commands, or use `OnlineDDL` command:
Execute via `vtctldclient ApplySchema --sql "..." <keyspace>` like previous commands, or use `OnlineDDL` command:


```shell
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -785,7 +785,7 @@ The command `show vitess_throttled_apps;` is a general purpose throttler command

### Via vtctlclient/ApplySchema

Execute via `vtctlclient -- ApplySchema --sql "..." <keyspace>` like previous commands, or use `OnlineDDL` commands:
Execute via `vtctldclient ApplySchema --sql "..." <keyspace>` like previous commands, or use `OnlineDDL` commands:


```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b480ac6

Please sign in to comment.