syncoid: Fix multiple regressions caused by #818 #931
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
#818 only added a functional test for the new feature of sorting snapshots by the
createtxg
property, so it and the existing tests did not catch the following regressions:Slower listing of snapshots' properties
From @phreaker0:
getsnaps
fallback fails due to the wrong argument being passed inFrom @Deltik:
getsnaps
parsing error in fallback mode due to non-snapshots appearing in the listFrom @Deltik:
Description
These three regressions are fixed in three separate commits:
perf(syncoid): Regression: Bad performance due to
zfs get all
Return to using
zfs get guid,creation,createtxg
to avoid the performance overhead ofzfs get all
.There is a per-host global cache to remember:
zfs get
supports the type filter argument,-t snapshot
andThe feature check introduced by subroutine
check_zfs_get_features
eliminates the need for agetsnaps
fallback recursion, as there is no longer any guesswork into what featureszfs get
supports.Fixes: #818 (comment)
fix(syncoid): Regression: Fallback recursion
$rhost
mutated alreadyAn oversight during the merging of subroutine
getsnapsfallback
intogetsnaps
(e301b5b1) caused the recursive call to prepend$sshcmd
to$rhost
again, leading to this error:Fixes: #818 (comment)
fix(syncoid): Regression:
zfs get
parser not compatible with fallbackIn the fallback mode, non-snapshot datasets would be included in the output, leading to this parsing error:
Fixes: #818 (comment)
How Has This Been Tested?
I haven't managed to figure out an easy way to test
syncoid
's new reduced feature set detection features in subroutinecheck_zfs_get_features
, so I performed manual acceptance tests with a FreeBSD 8.3 machine, which is preloaded with an old version of ZFS that would trigger what was formerly known asgetsnapsfallback
because it does not supportzfs get -t snapshot
.I created some dummy snapshots:
And then was able to
syncoid
them out:To test the supported properties detection feature, I added a fake requested property and observed that it was not detected as a supported property:
Types of Changes