Problem/Justification
In some cases (multiple snapshot tasks point at the same dataset or replications are used) it is necessary to enable the checkbox “Allow Taking Empty Snapshots”. However, this makes all lists of snapshots (/ui/datasets/snapshots, Shadow Copies, Snapshot Directory visible) very confusing.
It would be helpful if there would be any option to simply hide empty snapshots, even if they physically exist.
Impact
The feature makes the usage of a huge number of snapshots more user-friendly.
User Story
What would constitute an “empty” snapshot? (I believe you mean “redundant”?)
A snapshot that consumes 0 KiB of space is a full filesystem. It is still useful to use as a reference for “What additional files were added after this point in time?”, among other questions and uses.
It would still have its own benefits.
Nor does its size at “0 KiB” provide any information on whether it differs from the snapshots that precede and follow it. This is because if each snapshot was created when new data was written to the filesystem (but no files were deleted), then each snapshot would indeed be different, yet consume 0 KiB.
So this means you cannot simply go by the “USED” property to consider a snapshot “empty” or “redundant”.
That leaves the following two methods of determining if the snapshot is “redundant” (which is what I believe you are implying):
- For sequential snapshots that show “USED” 0 KiB, compare their “REFER” size (down to the exact bytes). If they are sequential, both have “USED” 0 KiB, and both “REFER” the same exact number of bytes, then you can be fairly certain that they are indeed redundant.
- Compare sequential snapshots of “USED” 0 KiB with
zfs diff
, and if the output is blank, you can assume they are redundant.
Can you see how as your snapshot list populates, it gets a bit convoluted and expensive to determine which snapshots to “hide”?
Another issue that might arise is that such snapshots (which are currently hidden) should not be hidden anymore, since they become “unique” when certain other snapshots are later pruned.
This is why there exists an option to “Skip the creation of an empty snapshot”, because the snapshot’s moment of birth is when tidiness matters.