-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zfs recv -F
: cannot restore to [...]: destination already exists (only if clone exist)
#2739
Comments
After digging in code I found, that it should destroy any snapshots that are above current sending state, so there is a code:
Which will return
And we will see exactly that error message (but it's not correct). So, my points is: a) zfs should check that stream can be received if rollback is forced prior to receiving all the stream; b) reported error message should clarify that stream can not be received because of children of target fs. |
@seletskiy Nice investigation and reproducer. A few comments:
In the case where there's a clone of a snapshot rollback can never succeed. The clone needs to be promoted, with
Absolutely, for this case we should return a different unique errno and print a clear message describing the problem and better yet what could be done to resolve it. Could you propose a patch for this? I'm happy to review it. |
By (a) I mean that right now check, that will ensure that there is no children on the target fs, will run only after actual receive is done, and it's quite irritating to see error message about unexpected clone fs after receiveing 1TB stream... So, maybe it's better to set some kind of lock on the target fs so it will not possible to make clone of snapshot if parent fs is under receive? |
Regarding (b): yep, I'll prepare a patch. |
This is still reproducible in master using the original test case above. Destroying the clone allows the stream to be received. |
Steps to reproduce:
Result:
Expected: recv command successfully completes or correct error message is reported.
It's reproduceable in 100% of cases on 0.6.3.
If clone is not created or flag
-F
is not used issue will not reproduce.The text was updated successfully, but these errors were encountered: