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

Docs: INSTANT DDL and RANGE PARTITIONING support for managed schema migrations #1899

Merged
merged 14 commits into from
Dec 3, 2024

Conversation

shlomi-noach
Copy link
Contributor

This PR documents INSTANT DDL support and RANGE PARTITIONING support for managed schema migrations.

We apply these changes for all supported versions, and a bit beyond, for good measure.

@shlomi-noach shlomi-noach requested review from deepthi and a team November 26, 2024 12:54
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for vitess ready!

Name Link
🔨 Latest commit e28b3ca
🔍 Latest deploy log https://app.netlify.com/sites/vitess/deploys/674f21478793e000088a99ce
😎 Deploy Preview https://deploy-preview-1899--vitess.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

❤️

@@ -39,6 +39,8 @@ Vitess respects the following flags. They can be combined unless specifically in

- `--postpone-launch`: initiate a migration that remains `queued` and only launches per user command. See [postponed migrations](../postponed-migrations).

- `--prefer-instant-ddl`: where possible, apply `ALGORITHM=INSTANT` to the migration. This is applicable to `ALTER TABLE` migrations with `vitess` strategy. Vitess pre-computes whether the migration is eligible for `INSTANT` DDL. The [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html) references an incomplete list of eligible changes. If applicable, vitess does not create a shadow table and the migration is not revertible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove the /8.0/ part of the URLs so that we don't need to update them later. That will redirect to the latest GA LTS version page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Vitess can predict whether a schema change is eligible to `INSTANT` DDL based on the existing table schema and the requested change. It is aware of the MySQL limitations (some of which are listed in the documentation) and can devise a plan for each distinct migration. If eligible for `INSTANT` DDL, and if `--prefer-instant-ddl` is specified, Vitess will automatically add `ALGORITHM=INSTANT` to the statement. Otherwise any `ALGORITHM` directive is ignored.

If chosen to run as `INSTANT` DDL, the migration has no shadow table and is not revertible.
only to actually execute hours later.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line seems like a leftover.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

special_plan: {"operation":"instant-ddl"}
```

Note the migration has not `artifacts`, and that it is executed with `special_plan: {"operation":"instant-ddl"}`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

has no artifacts,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
@shlomi-noach shlomi-noach merged commit c6e15b2 into prod Dec 3, 2024
5 checks passed
@shlomi-noach shlomi-noach deleted the docs-ddl-strategy-prefer-instant-ddl branch December 3, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants