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

OnlineDDL: skip GetSchema where possible #10107

Merged

Conversation

shlomi-noach
Copy link
Contributor

Description

In ApplySchema, there is a check for big schema changes. This is a legacy check from a time when we did not support online DDL. Big-schema-changes is mostly skipped when there are online DDLs. However, one step is not skipped, which is GetSchema.

Currently, we first GetSchema, then iterate all DDLs, and for each DDL check if it is online or not, and if not - whether it is a "big change".

When all DDLs are online, the GetSchema step is wasteful. It reads all tables with some metadata.

In this PR, we first do a preliminary check to see whether there is at all any non-online DDL. If there is at least one non-online DDL, we proceed with GetSchema. But if all DDLs are online - we skip GetSchema altogether.

Related Issue(s)

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation was added or is not required

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

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

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

lgtm

@shlomi-noach shlomi-noach merged commit 54e61a5 into vitessio:main Apr 20, 2022
@shlomi-noach shlomi-noach deleted the get-schema-skip-if-online-ddl branch April 20, 2022 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Cluster management 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

2 participants