vttablet - add '-restore_from_backup_ts' flag#7998
vttablet - add '-restore_from_backup_ts' flag#7998guidoiaquinti wants to merge 1 commit intovitessio:mainfrom
Conversation
1f6e157 to
30ff43a
Compare
There was a problem hiding this comment.
The main objection to this is that after restoring from the backup, the replica will try to catch-up using binlogs and if binlogs have been rotated out, then the replica will fail to go into serving.
With the current restore functionality (using the most recent backup), we can reasonably assume that binlogs are available.
The first usecase in #4905 is now covered by PITR. For the second use-case of backup validation, the way the issue is written, I assume it is expected to fail if binlogs are not available?
Yes and I think we can consider this "by design" and it depends on each setup (how often do you run backups and what's the binlog retention policy). |
deepthi
left a comment
There was a problem hiding this comment.
Mostly LGTM, but needs an actual test case.
Signed-off-by: Guido Iaquinti <giaquinti@slack-corp.com>
30ff43a to
e0d72e7
Compare
|
Hi @guidoiaquinti ! I can try and help to get this PR completed and merged (with a new test case) if you like. Or if you'd rather I can carry it forward in a new PR (giving you credit in the description/commit). Just let me know what you would prefer. Thank you for contributing! Matt |
|
👋 Hi @mattlord , I apologise if this PR has gone stale, but other priorities took over. Unfortunately, I don’t think I have time to work on it soon. Feel free to carry it on if you have some time. Thanks again! |
|
Closing this and carrying it forward here: #8824 Thank you for the PR @guidoiaquinti ! I'll make sure that you retain the proper credit/attribution. 😃 |
By default Vitess will only make practical use of the latest backup of a given shard. While this makes perfect sense for the common use cases there are times where you need to restore a specific backup. For example: 1. In order to extract a portion of the data that can then be merged with the current state. For example if you later realize that you accidentally deleted some records in a table that you shouldn't have last week, and you need to perform a restore so that you can copy those specific records back to the live data set. 2. To perform validation, forensics, analysis on the system state at that time. 3. A specific PITR for whatever reason ... This is a continuation of: vitessio#7998 This solves: vitessio#4905 Co-authored-by: Guido Iaquinti <giaquinti@slack-corp.com> Signed-off-by: Matt Lord <mattalord@gmail.com>
Description
Add a new
-restore_from_backup_tsflag invttabletto restore the last backup taken at or before the provided timestamp.Note: in a future iteration we could also add this functionality to the
RestoreFromBackupgRPC call.Related Issue(s)
This should address #4905.
Checklist
Deployment Notes
N/A