You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/18.0/reference/errors/query-serving.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ These error messages are internal to Vitess. If you are getting other errors fro
46
46
| VT05006 | The given system variable is unknown. | unknown system variable '%s' | 1193 | HY000 |
47
47
| VT05007 | Table information is not available. | no table info | 0 ||
48
48
| VT06001 | The given database name already exists. | cannot create database '%s'; database exists | 1007 | HY000 |
49
+
| VT07001 | Kill statement is not allowed. More in docs about how to enable it and its limitations. | %s | 1095 | HY000 |
49
50
| VT09001 | the table does not have a primary vindex, the operation is impossible. | table '%s' does not have a primary vindex | 1173 | 42000 |
50
51
| VT09002 | This type of DML statement is not allowed on a replica target. | %s statement with a replica target | 1874 | HY000 |
51
52
| VT09003 | A vindex column is mandatory for the insert, please provide one. | INSERT query does not have primary vindex column '%v' in the column list | 0 ||
@@ -58,6 +59,9 @@ These error messages are internal to Vitess. If you are getting other errors fro
58
59
| VT09010 | SHOW VITESS_THROTTLER STATUS works only on primary tablet. | SHOW VITESS_THROTTLER STATUS works only on primary tablet | 0 ||
59
60
| VT09011 | The prepared statement is not available | Unknown prepared statement handler (%s) given to %s | 1243 | HY000 |
60
61
| VT09012 | This type of statement is not allowed on the given tablet. | %s statement with %s tablet not allowed | 0 ||
62
+
| VT09013 | Durability policy wants Vitess to use semi-sync, but the MySQL instances don't have the semi-sync plugin loaded. | semi-sync plugins are not loaded | 0 ||
63
+
| VT09014 | The vindex cannot be used as table in DML statement | vindex cannot be modified | 0 ||
64
+
| VT09015 | This query cannot be planned without more information on the SQL schema. Please turn on schema tracking or add authoritative columns information to your VSchema. | schema tracking required | 0 ||
61
65
| VT10001 | Foreign key constraints are not allowed, see https://vitess.io/blog/2021-06-15-online-ddl-why-no-fk/.| foreign key constraints are not allowed | 0 ||
62
66
| VT12001 | This statement is unsupported by Vitess. Please rewrite your query to use supported syntax. | unsupported: %s | 0 ||
63
67
| VT13001 | This error should not happen and is a bug. Please file an issue on GitHub: https://github.com/vitessio/vitess/issues/new/choose.|[BUG] %s | 0 ||
Copy file name to clipboardExpand all lines: content/en/docs/18.0/reference/programs/vtctl/schema-version-permissions.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,11 +149,11 @@ Validates that the schema on the primary tablet for shard 0 matches the schema o
149
149
150
150
### ApplySchema
151
151
152
-
Applies the schema change to the specified keyspace on all shards. The recommended method of applying schema changes is via [Online DDL](../../../../user-guides/schema-changes/managed-online-schema-changes/), which ensures migrations are non-blocking and keeps replication in sync throughout the operation. --ddl_strategy is used to instruct migrations via vreplication, `gh-ost` or `pt-osc` with optional parameters. -request_context allows the user to specify a custom request context for online DDL migrations. If --skip_preflight, SQL goes directly to shards without going through sanity checks.
152
+
Applies the schema change to the specified keyspace on all shards. The recommended method of applying schema changes is via [Online DDL](../../../../user-guides/schema-changes/managed-online-schema-changes/), which ensures migrations are non-blocking and keeps replication in sync throughout the operation. --ddl_strategy is used to instruct migrations via vreplication, `gh-ost` or `pt-osc` with optional parameters. -request_context allows the user to specify a custom request context for online DDL migrations.
@@ -162,7 +162,6 @@ Applies the schema change to the specified keyspace on all shards. The recommend
162
162
| caller_id | string | Effective caller ID used for the operation and should map to an ACL name which grants this identity the necessary permissions to perform the operation (this is only necessary when strict table ACLs are used). |
| request_context | string | For Only DDL, optionally supply a custom unique string used as context for the migration(s) in this command. By default a unique context is auto-generated by Vitess. |
165
-
| skip_preflight | Boolean | Skip pre-apply schema checks, and directly forward schema change query to shards. Ignored when using Online DDL |
166
165
| sql | string | A list of semicolon-delimited SQL commands. |
167
166
| sql-file | string | Identifies the file that contains the SQL commands. This file needs to exist on the server, rather than on the client. |
168
167
| wait_replicas_timeout | Duration | The amount of time to wait for replicas to receive the schema change via replication (default 10s). |
--allow-long-unavailability Deprecated and has no effect.
33
-
--batch-size int How many queries to batch together. Only applicabel when all queries are CREATE TABLE|VIEW
33
+
--batch-size int How many queries to batch together. Only applicable when all queries are CREATE TABLE|VIEW
34
34
--caller-id string Effective caller ID used for the operation and should map to an ACL name which grants this identity the necessary permissions to perform the operation (this is only necessary when strict table ACLs are used).
Copy file name to clipboardExpand all lines: content/en/docs/18.0/user-guides/schema-changes/advanced-usage.md
+23-13Lines changed: 23 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,9 @@ Thus, the new migration does not get to execute if an identical previous migrati
33
33
Usage:
34
34
35
35
```sh
36
-
$ vtctldclient ApplySchema -- --migration_context="1111-2222" --skip_preflight --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
36
+
$ vtctldclient ApplySchema -- --migration_context="1111-2222" --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
37
37
38
-
$ vtctldclient ApplySchema -- --migration_context="1111-2222" --skip_preflight --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
38
+
$ vtctldclient ApplySchema -- --migration_context="1111-2222" --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
39
39
```
40
40
41
41
In the above, the two calls are identical. Specifically, they share the exact same `--migration_context` value of `1111-2222`, and the exact same `--sql`.
@@ -49,16 +49,26 @@ Notes:
49
49
- Continuing the above example: if the new migration is successful, the previous migration remains in `failed` state.
50
50
- The decision whether to run the migration or to mark it as implicitly `complete` only takes place when the migration is scheduled to run.
51
51
52
+
The context may also be set via VTGate:
53
+
54
+
```sql
55
+
mysql>set @@ddl_strategy='vitess --';
56
+
mysql>set @@migration_context='1111-2222';
57
+
mysql> alter table customer add column status int unsigned not null;
58
+
```
59
+
60
+
By default, the migration context for an Online DDL issued via VTGate is the value of `@@session_uuid`. If `@@migration_context` is non-empty, then its value is used.
61
+
52
62
## Duplicate migration indication
53
63
54
64
You may go one step beyond [duplicate migration detection](#duplicate-migration-detection) by explicitly supplying migration UUIDs such that duplicate migrations are never submitted in the first place.
55
65
56
66
Consider the following example, note `--uuid_list` flag:
57
67
58
68
```sh
59
-
$ vtctldclient ApplySchema -- --uuid_list "73380089_7764_11ec_a656_0a43f95f28a3" --skip_preflight --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
69
+
$ vtctldclient ApplySchema -- --uuid_list "73380089_7764_11ec_a656_0a43f95f28a3" --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
60
70
61
-
$ vtctldclient ApplySchema -- --uuid_list "73380089_7764_11ec_a656_0a43f95f28a3" --skip_preflight --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
71
+
$ vtctldclient ApplySchema -- --uuid_list "73380089_7764_11ec_a656_0a43f95f28a3" --ddl_strategy='vitess' --sql "alter table customer add column status int unsigned not null" commerce
62
72
```
63
73
64
74
Normally Vitess generates a `UUID` for each migration, thus having a new, unique ID per migration. With `-uuid_list`, you can force Vitess into using your own supplied UUID. There cannot be two migrations with the same `UUID`. Therefore, any subsequent submission of a migration with an already existing `UUID` is implicitly discarded. The 2nd call does return the migration `UUID`, but is internally discarded.
@@ -86,7 +96,7 @@ The user may submit multiple migrations such that non auto-completes. The user c
86
96
Consider the following:
87
97
88
98
```sh
89
-
$ vtctldclient ApplySchema --skip_preflight --ddl_strategy='vitess --postpone-completion --allow-concurrent' --sql "alter table customer add column country int not null default 0; alter table order add column shipping_country int not null default 0" commerce
99
+
$ vtctldclient ApplySchema --ddl_strategy='vitess --postpone-completion --allow-concurrent' --sql "alter table customer add column country int not null default 0; alter table order add column shipping_country int not null default 0" commerce
90
100
29231906_776f_11ec_a656_0a43f95f28a3
91
101
3cc4ae0e_776f_11ec_a656_0a43f95f28a3
92
102
```
@@ -98,14 +108,14 @@ A `show vitess_migrations like '29231906_776f_11ec_a656_0a43f95f28a3'` presents
98
108
When all migrations for the relevant UUIDs show `1` for `ready_to_complete`, the user can then either:
Which means we want to apply the revert. Since the revert is already running in the background, it is likely that binary log processing is up to date, and cut-over is near instantaneous.
@@ -171,7 +181,7 @@ Note that there can be scenarios with impossible ordering. Those hardly make sen
171
181
An example for in-order submission:
172
182
173
183
```sh
174
-
$ vtctldclient ApplySchema --skip_preflight --ddl_strategy='vitess --allow-concurrent --in-order-completion' --sql "create table t1 (id int primary key); create view v1 as select id from t1;" commerce
184
+
$ vtctldclient ApplySchema --ddl_strategy='vitess --allow-concurrent --in-order-completion' --sql "create table t1 (id int primary key); create view v1 as select id from t1;" commerce
0 commit comments