Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for vtgate -enable_direct_ddl flag #8116

Merged
merged 5 commits into from
May 13, 2021

Conversation

shlomi-noach
Copy link
Contributor

Description

We add a -enable_direct_ddl (bool) flag to vtgate. The default is true.
It is now possible to disable direct DDL via vtgate. If you run vtgate -enable_direct_ddl=false, then, for example:

$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1

mysql> select @@ddl_strategy;
+----------------+
| @@ddl_strategy |
+----------------+
| direct         |
+----------------+
1 row in set (0.00 sec)

mysql> create table my_test(id int primary key);
ERROR 1105 (HY000): direct DDL is disabled

This variable only controls direct (non-online) DDLs. As reminder, online DDL can be controlled via -enable_online_ddl. It is possible to enable one and disable another, enable both, or disable both.

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

cc @piki @deepthi @mavenraven

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach
Copy link
Contributor Author

This change only affects vtgate. Schema changes via vtctl ApplySchema are unaffected by this flag.

@askdba askdba added Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature) labels May 13, 2021
@systay
Copy link
Collaborator

systay commented May 13, 2021

Would be nice if you could add a test

@shlomi-noach
Copy link
Contributor Author

re: test, I agree; but the only way I can see it is if I spawn a dedicated new endtoend test just for this, becaus eit entails starting vtgate with the new flag. Any thoughts?

@systay
Copy link
Collaborator

systay commented May 13, 2021

well, how about the planner not directly depending on the flag, and have this value be given to the planner from the outside.
this makes the dependency explicit and makes it easier to test. WDYT?

… package

Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
@systay systay merged commit e662e46 into vitessio:master May 13, 2021
@systay systay deleted the vtgate-allow-ddl-flag branch May 13, 2021 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants