Skip to content

VTGate: support -enable_online_ddl flag#7694

Merged
shlomi-noach merged 5 commits intovitessio:masterfrom
planetscale:vtgate-enable-online-ddl-flag
Apr 5, 2021
Merged

VTGate: support -enable_online_ddl flag#7694
shlomi-noach merged 5 commits intovitessio:masterfrom
planetscale:vtgate-enable-online-ddl-flag

Conversation

@shlomi-noach
Copy link
Contributor

@shlomi-noach shlomi-noach commented Mar 16, 2021

This PR extends #7663, unmerged at this time. It only makes sense to review once #7663 is merged.

Description

This PR introduces a new command line flag: -enable_online_ddl, which defaults true. With this flag it is possible to completely disable Online DDL related queries coming from VTGate. These queries are:

  • Submission of anew migration (CREATE/ALTER/DROP when @@ddl_strategy is an online strategy, ie != direct)
  • SHOW VITESS_MIGRATIONS ... SHOW is allowed because they are read-only.
  • ALTER VITESS_MIGRATION ...
  • REVERT VITESS_MIGRATION ...

This is a global, read-only setting, and cannot be changes once VTGate is up.

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

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

For convenience, these are the changes specific to this PR: planetscale/vitess@online-ddl-sql-interface-alter...vtgate-enable-online-ddl-flag

@shlomi-noach
Copy link
Contributor Author

shlomi-noach commented Mar 16, 2021

Will only mark as "Ready for Review" once #7663 is merged.

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach shlomi-noach marked this pull request as ready for review March 21, 2021 07:05
@shlomi-noach
Copy link
Contributor Author

Ready for review.

Documentation to follow.

@shlomi-noach
Copy link
Contributor Author

Ping, ready for review please /cc @piki

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
)

var (
enableOnlineDDL = flag.Bool("enable_online_ddl", true, "Allow users to submit, review and control Online DDL")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to have flags all the way in here. Most vtgate flags live here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@systay right! I began that way, but then got into a circular import error, since vtgate package imports planbuilder package, thus I can't reference vtgate package back from planbuilder. Any ideas are welcome.

@shlomi-noach
Copy link
Contributor Author

Because we're freezing RC tomorrow, and because we have a use case, I'm gonna merge this PR; there's this question to address, but we can always refactor later.

@shlomi-noach shlomi-noach merged commit 244d943 into vitessio:master Apr 5, 2021
@shlomi-noach shlomi-noach deleted the vtgate-enable-online-ddl-flag branch April 5, 2021 13:12
@askdba askdba added this to the v10.0 milestone Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants