-
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
Adds support for property overrides (WIP) #1867
Conversation
Adds support for property overrides (-o property=value), property excludes (-x property) and dataset limits (-l <volume|filesystem>) to zfs receive. Both -o and -x options mirror the functionality already available in Oracle's ZFS implementation which is also mentioned in the upstream feature request openzfs#2745: The -l option allows receive to be limited to specific datasets within the stream effectively allowing partial restores from a multi dataset stream. References: https://www.illumos.org/issues/2745 Ported-by: Milan-Benes Issue openzfs#1350 NOTES: Man page updates missing and must be added, see patch: http://blog.multiplay.co.uk/dropzone/freebsd/zfs-recv-properties.patch
copy/paste from my review of this code on [email protected]: I don't quite follow the documentation around the "-o" and "-x" flags:
I just read the Oracle documentation. It sounds like they implemented it so that "-o prop=val" implements the option C that I described: set the property on the topmost filesystem, and "force inherit" it onto all descendants (doing the equivalent of a "zfs inherit" on each of the descendants). And I am guessing that they made "-x" do the equivalent of "zfs inherit" after receiving the property. These semantics seems reasonable, and I think we should implement the same behavior. I'm also fine with dropping the "dataset#prop" stuff. If we are to take the changes as-is, I would like to see a strong argument for why we should implement a feature that on the surface appears to be the same as an Oracle ZFS feature, but is actually subtly different. Really what I would like to see is a comparison of the behavior of these changes and Oracle ZFS. It should cover things like: Incremental receive, where the property is set on child filesystems; does -o prop=value set the property on all the filesystems? Does it set the property on the top filesystem that is received and the children inherit that prop? For example, if you do "zfs send -R test/ds@a | zfs recv -o sharenfs=rw test/recvd", I think that Oracle ZFS would result in the following:
I.e. the result of doing "zfs set sharenfs=rw test/recvd; zfs inherit sharenfs test/recvd/child". I don't see how the code under review would accomplish this. It seems like it would do "zfs set sharenfs=rw test/recvd; zfs set sharenfs=rw test/recvd/child". |
Initial man page for this can be found in FransUrbo@8b7dfd3. Formatting might be somewhat off though. There's a few things in the patch mentioned I don't quite understand:
|
In testing this, I noticed that you'd need to use the |
Closing as stale. |
The patch work quite nicely though! I've been running it for a very long time, so closing it might be premature... |
The idea here is definitely a good one, but these changes here need to be reviewed and rebased by someone. Ideally, we'd want to coordinate with upstream illumos, see https://www.illumos.org/issues/2745. |
Adds support for property overrides (-o property=value), property
excludes (-x property) and dataset limits (-l <volume|filesystem>)
to zfs receive.
Both -o and -x options mirror the functionality already available
in Oracle's ZFS implementation which is also mentioned in the
upstream feature request #2745:
The -l option allows receive to be limited to specific datasets within
the stream effectively allowing partial restores from a multi dataset
stream.
References:
https://www.illumos.org/issues/2745
Ported-by: Milan-Benes
Issue #1350
NOTES: Man page updates missing and must be added, see patch:
http://blog.multiplay.co.uk/dropzone/freebsd/zfs-recv-properties.patch