-
Notifications
You must be signed in to change notification settings - Fork 406
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
feat: implement restore operation #1502
Conversation
I will file python binding implement in another PR. Is that OK? |
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.
Thaks for taking care of this @loleek - left a minor comment re naming, otherwise looking great!
if !ignore_missing_files { | ||
check_files_available(object_store.as_ref(), &files_to_add).await?; | ||
} |
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.
interesting - would not have thought that it is useful, to delivberately create a state with missing files, but it seems the reference implementation also supports this :).
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 data file may missing for many reason, deleted unintentionally or by vacuum operation.This will cause data missing if always allow to restore, so we must make users aware of the problem.
match try_commit_transaction(object_store.as_ref(), &commit, commit_version).await { | ||
Ok(_) => {} | ||
Err(err @ TransactionError::VersionAlreadyExists(_)) => { | ||
return Err(err.into()); | ||
} | ||
Err(err) => { | ||
object_store.delete(&commit).await?; | ||
return Err(err.into()); | ||
} | ||
} |
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.
Just making sure I understand. For restore we always want to fail, if any other operation was performed on the table?
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.
Yes, if any other operation was performed, the restore is invalid because the ADD and REMOVE files are computed based on latest snapshot state and state of restored version.
Indeed it is not, unfortunately we have some flakiness in the tests due to memory issues. |
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.
Thanks for the great contribution, @loleek!
Description
This is a implementation of the Restore Command.
Related Issue(s)
#837