-
Notifications
You must be signed in to change notification settings - Fork 897
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
Support for DB Restore from Object Stores #17791
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,8 @@ def self.restore(db_opts, connect_opts = {}) | |
# :username => 'samba_one', | ||
# :password => 'Zug-drep5s', | ||
|
||
uri = with_mount_session(:restore, db_opts, connect_opts) do |database_opts, _session, _remote_file_uri| | ||
uri = with_mount_session(:restore, db_opts, connect_opts) do |database_opts, session, _remote_file_uri| | ||
database_opts[:local_file] = session.download(database_opts[:local_file], connect_opts[:remote_file_name]) if session | ||
prepare_for_restore(database_opts[:local_file]) | ||
|
||
# remove all the connections before we restore; AR will reconnect on the next query | ||
|
@@ -110,6 +111,7 @@ def self.restore(db_opts, connect_opts = {}) | |
if db_opts[:local_file].nil? | ||
if action == :restore | ||
uri = connect_opts[:uri] | ||
connect_opts[:remote_file_name] ||= connect_opts[:uri] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can remove this and use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! I knew there was something we changed that could handle that. Thanks. Changing now. |
||
connect_opts[:uri] = File.dirname(connect_opts[:uri]) | ||
else | ||
connect_opts[:remote_file_name] ||= File.basename(backup_file_name(action)) | ||
|
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.
I think
connect_opts[:remote_file_name]
here can just be the yieldedremote_file_uri