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 |
waynew
left a comment
There was a problem hiding this comment.
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
This retires our custom patch for CES-206 saltstack/salt#59970
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_presentandzfs.volume_presentstates.Previous Behavior
zfs.filesystem_presentwould 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