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

Feature Request: introduce mysql DDL strategy, managed, but executed with MySQL DDL #12075

Closed
shlomi-noach opened this issue Jan 11, 2023 · 1 comment

Comments

@shlomi-noach
Copy link
Contributor

Feature Description

We wish to introduce a new DDL strategy for Online DDL, termed mysql. A migration submitted with this strategy is managed, which means it is handled by the Online DDL scheduler. It goes through queued, ready, running, complete` phases. It can be retried or cancelled.

But the execution itself of the migration, specifically for ALTER TABLE, it to run the command directly on MySQL. This could happen to be a non-blocking migration (e.g. ALTER TABLE t ADD COLUMN c INT DEFAULT 0, ALGORITHM=INSTANT) or it could be a fully blocking operation. It's up to the specific query and the specific MySQL version running that query, as per https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl-operations.html or https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html.

Notes:

  • with this strategy it is impossible to CANCEL a running migration.
  • there is no progress indication to a migration.
  • ALTER migrations are non-revertible
  • ALTER migrations do not support --postpone-completion
  • ALTER migrations do not support --allow-concurrent

Use Case(s)

Some users will want to use MySQL as the engine because of:

  • Limitations to the vitess/gh-ost strategies, such as specific key requirements
  • To enforce running a migration as INSTANT or none at all (a migration submitted with ALTER TABLE ... ALGORITHM=INSTANT will fail if MySQL finds it impossible to apply the INSTANT algorithm)
  • As a failsafe mechanism

But those users will enjoy the managed aspect of the migration (as opposed to direct):

  • There is a record of the migration
  • It can be reviewed
  • It can be retried
  • The scheduler will resolve concurrency issues, will queue and run the migration in the appropriate time

All in all, it's yet another option we give the user to choose from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant