-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix encrypted dataset restore and make backup cron setting optional #68
Fix encrypted dataset restore and make backup cron setting optional #68
Conversation
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.
Thank you for the contribution!
I added the -F
option to fix an issue where the restore would fail if data had been written to the file system since the most recent snapshot. #33
I'll have to look into your issue in more detail. It may be worth adding some tests that replicate #33 and the encrypted restore issue.
I can try to add the test for the encrypted case, but this is basically the workflow:
Should we consider adding a boolean flag to the restore operation to pass in the -F like (--force)? Restoring on top of a dataset that has changes would indeed cause data loss |
@rdelcorro Could you merge in |
@ddebeau code is now merged. Thanks! |
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 a couple quick fixes and the PR should be ready to merge.
Corrected the comments. Feel free to merge when possible. I do not seem to have the ability to do so. Do you know why tests are failing? |
I don't think your PR has access to the secrets required to run the tests. I'll run the tests before I make a release. Thank you for your help! |
@rdelcorro Just made the release: |
Thanks, I will test it out |
As stated in the docs, the cron config should be optional. When not providing a cron config, it was crashing on backup as its dereferenced in the add_job call.
The tool was correctly using the raw method to upload the send binary but on receive / restore, it was first creating a datastore and then forcing a rewrite with the -F flag. This poses a problem on encrypted datasets as you can't restore with -F. See zfs receive -F cannot be used to destroy an encrypted filesystem openzfs/zfs#6793 for more information. This change removes the -F but also does not create the dataset, which should be fine as receive would do that anyways. Tested on encrypted datasets and now its working