-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Speed up zfs.filesystem_present #59970
Conversation
e3690ff
to
9748f77
Compare
Hm. The macosx and freebsd test failures are unrelated, but the debian9 failure is my fault. I'll try to fix that. |
2a136fe
to
cd8f5bd
Compare
I just rebased onto master, which I hope will fix the libgit2-related test failures on freebsd. |
144294a
to
0166848
Compare
Ok, I don't think any of the remaining test failures are related to the PR. @xeacott if you approve the changes, I'll squash my commits. |
No worries on squashing the commits, keeping all the history is fine but I think I'm good with this |
@krionbsd review once more? |
@asomers looks like there's a conflict, do you think you can rebase this? |
Only look up the requested properties in ZFS, instead of all properties. This affects zfs.volume_present, too. Sponsored by: Axcient
Remove an assumption about the order of python's hash function.
* a "filesystem.present" or "volume.present" state that specified no properties would fail because it would execute "zfs get" with no property argument. Fix this (and improve performance too) by skipping the "zfs get" if the user does not request any property values. * A "volume.present" state that specified volume_size but no properties would fail to check the volsize. Also, make the properties argument of _dataset_properties a mandatory argument rather than a keyword argument. All callers already specify this argument, making the default value a red herring.
f2b7e0b
to
ac889a3
Compare
rebased, @waynew . |
The test failures look unrelated to this PR. |
Thanks! Let's see if the failures are just flaky tests |
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.
Looks good - I think there are some improvements that could be made here but given this is blocking a related PR, and everything is passing, I think we should go ahead and merge this and the changes can be made in the other PR
Only look up the requested properties in ZFS, instead of all properties.
This affects zfs.volume_present, too.
Sponsored by: Axcient
What does this PR do?
Speeds up the
zfs.filesystem_present
andzfs.volume_present
states.Previous Behavior
zfs.filesystem_present
would runzfs get -Hp -o name,value,source all <dataset>
to look up all properties of the dataset. That's slow, because some of those properties can be overridden at mount time, and libzfs searches through all mounted file systems to find them.New Behavior
A state like this:
Will run
zfs get -Hp -o name,value,source compression <dataset>
, which is much faster.Merge requirements satisfied?
Commits signed with GPG?
Yes