-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Incremental logical backup and point in time recovery #11097
Conversation
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
…mPosition in the manifest. Add 'Incremental' (bool) to the manifest Signed-off-by: Shlomi Noach <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
go/vt/mysqlctl/backup.go
Outdated
params.Logger.Infof("Restore: %v", restorePath.String()) | ||
if params.DryRun { | ||
return nil, vterrors.Errorf(vtrpc.Code_CANCELED, "Restore: dry run, aborting operation") | ||
} |
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.
in the dry run case, do we need to return an error?
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.
It's a way to break through all layers up, without anyone attempting to actually use the backup result. Do you think we should return a nil
for error?
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.
my understanding is dry run is used by the user to see what steps will be taken and does all the pre-condition checks pass or not, before actually running it.
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.
that's correct. Well, let me look into it.
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.
The change was made. No longer returning an error, and now exiting gracefully. The log looks something like this:
restore.go:202] Restore: original tablet type=RDONLY
backup.go:289] Restore: looking for a suitable backup to restore
backup.go:340] Restore: RestorePath: [full:2022-11-28.063331.zone1-0000000102, incremental:2022-11-28.063340.zone1-0000000102, incremental:2022-11-28.063343.zone1-0000000102, incremental:2022-11-28.063348.zone1-0000000102]
restore.go:230] Restore: got a restore manifest: <nil>, err=<nil>, waitForBackupInterval=0s
restore.go:289] Dry run. No changes made
restore.go:311] Restore: changing tablet type to RDONLY
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
I still need to write release notes, as well as website docs. |
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Release notes added. |
bwahahaha! It is merged! |
Description
This PR introduces incremental backups, towards point in time recovery (which may or may not happen in this PR).
Incremental backups are only available for:
builtin
backup methodAs reminder,
builtin
backup is a full backup taken by shutting down the server and copying over files.The incremental backup is done by creating a backup of binary log files. The MySQL server is not stopped nor interrupted by this operation.
An incremental backup is taken like so:
In the above we ask Vitess to create an incremental backup that covers
MySQL56/16b1039f-22b6-11ed-b765-0a43f95f28a3:1-615
. Since the backup method is to copy complete binlog files, it's possible that the backup actually starts at an earlier position. Vitess does not impose that the position is at a binary log rotation.The backup fails if:
The backup's manifest has been updated with new fields. Here's a new manifest:
"Incremental": true,
--incremental_from_pos
. This value is empty for full backup.ServerUUID
is new and self explanatory, added for convenienceTabletAlias
is new and self explanatory, added for convenienceAdded some unit tests. WIP to add endtoend tests.
Related Issue(s)
#11227
Checklist
Deployment Notes