-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Backups: Add Support for Backup Init SQL Queries #18883
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
Conversation
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
84b0f2f to
46c4392
Compare
Signed-off-by: Matt Lord <[email protected]>
46c4392 to
b18a94c
Compare
Signed-off-by: Matt Lord <[email protected]>
8279753 to
893d848
Compare
Signed-off-by: Matt Lord <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #18883 +/- ##
==========================================
+ Coverage 69.77% 69.82% +0.05%
==========================================
Files 1608 1610 +2
Lines 214908 215299 +391
==========================================
+ Hits 149953 150339 +386
- Misses 64955 64960 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Matt Lord <[email protected]>
0d295ee to
4a1d0d2
Compare
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
arthurschreiber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. I'm only a bit confused about the usefulness of the --init-backup-tablet-types flag. How do you intend for it to be used? 🙇♂️
Thanks! ❤️ You may only want to backup RDONLY tablets -- at least when available. Same for REPLICA tablets. And there are times where you might be forced to backup a PRIMARY tablet. The init statements may only be applicable/desirable/safe on a subset of those tablet types. That's the thinking behind it. Does that make sense? |
timvaillancourt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one question that should not change my review. LGTM 👍
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
|
Docs PR: vitessio/website#2039 |
Signed-off-by: Matt Lord <[email protected]> Signed-off-by: Nick Van Wiggeren <[email protected]>
Description
This PR adds a new feature to Vitess Backups that is similar to these MySQL features
--init-file: https://dev.mysql.com/doc/refman/en/server-system-variables.html#sysvar_init_file--init-connect: https://dev.mysql.com/doc/refman/en/server-system-variables.html#sysvar_init_connectIt allows users to specify a set of flags — via automated backups using
vtbackupor via thevtctldclientBackupandBackupShardcommands — which then support the ability to run a set of SQL commands on themysqldinstance before we back it up:--init-backup-sql-queries- Queries to execute before initializing the backup (flag can be specified multiple times or you can provide a CSV string)--init-backup-tablet-types- Tablet types used for the backup where the init SQL queries (--init-backup-sql-queries) will be executed before initializing the backup (flag can be specified multiple times or you can provide a CSV string)--init-backup-sql-timeout- At what point should we time out the init SQL query (--init-backup-sql-queries) work and either fail the backup job (--init-backup-sql-fail-on-error) or continue on with the backup--init-backup-sql-fail-on-error- Whether or not to fail the backup if the init SQL queries (--init-backup-sql-queries) fail, which includes if they fail to complete before the specified timeout (--init-backup-sql-timeout) (defaults to FALSE)If any queries are specified then non-default values for the tablet-types and timeout flags must also be provided.
This supports any number of uses cases for users, including the one mentioned in the issue.
Note
Once the PR gets approval I will create a website PR to update the docs.
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure
My man Claude did the bulk of the unit test work.