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

vtctl ApplySchema supports '-request_context' flag #7777

Merged

Conversation

shlomi-noach
Copy link
Contributor

Description

An online DDL migration is associated with both a unique UUID as well as a migration_context, aka the "context".

The context is unique to the scope/origin of the request.

  • from VTGate, you can run multiple migrations, each has a unique UUID, but all share the same context which is the @@session_uuid.
  • In a single vtctl ApplySchema command you may specify multiple DDLs; each has its own unique UUID but all share the same context.

The context is useful to logically grouping migrations.

Until today, vtctl would auto-generate the migration context. This PR allows the user to optionally override that, and specify their own context. It is the user's responsibility to handle uniqueness of the context.

The recommendation is to use a UUID format, preceded with an identity of the originator, as is the status today. Examples:

  • vtgate:a8352418-8d55-11eb-815f-f875a4d24e90
  • vtctl:fa4a2e13-8a46-11eb-85f5-f875a4d24e90

At this time the migration context is strictly a logical tag, used to search/filter migrations. Supplying a non-unique context does not break the migrations in any way.

Related Issue(s)

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 shlomi-noach requested a review from a team April 4, 2021 12:40
Copy link
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

lg2m!

@shlomi-noach shlomi-noach merged commit eae01ce into vitessio:master Apr 6, 2021
@shlomi-noach shlomi-noach deleted the apply-schema-custom-context branch April 6, 2021 05:35
@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