Having used btrfs before, I was surprised to find out that rolling back a snapshot in ZFS not only changes the “working set” of files, but also requires that any snapshots which are newer than the rollback target must be destroyed as well:
zfs rollback [-Rfr] snapshot
Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all
data that has changed since the snapshot is discarded, and the dataset reverts to the
state at the time of the snapshot. By default, the command refuses to roll back to a
snapshot other than the most recent one. In order to do so, all intermediate snapshots
and bookmarks must be destroyed by specifying the -r option.
For comparison, here are some descriptions of non-destructively rolling back to a snapshot in btrfs:
btrfs sub snap -r fs snapshot
# ... do things on fs
btrfs sub del fs # at which point you'll lose those things you've done
# if you want to preserve them, just rename fs instead
btrfs sub snap snapshot fs # reinstate snapshot as a read+write fs
btrfs sub del snapshot # delete the non-longer needed read-only snapshot
and non-destructively rolling back to a snapshot in ZFS:
zfs snapshot pool/project/production@today
zfs clone pool/project/production@today pool/project/beta
# make changes to /pool/project/beta and test them
zfs promote pool/project/beta
zfs rename pool/project/production pool/project/legacy
zfs rename pool/project/beta pool/project/production
# once the legacy version is no longer needed, it can be destroyed
zfs destroy pool/project/legacy
A “snapshot” is obviously a different thing in btrfs and ZFS, but I’m wondering what the advantage of having the destructive zfs rollback operation is, especially since there doesn’t seem to be a self-contained non-destructive rollback command. I would expect that, unless explicitly requested, the most commonly needed rollback operation is one that only affects the current state of files, and not other, unrelated snapshots based on the arbitrary criterion of when they were created.
I can imagine several kinds of reasons (e. g. historical, performance, storage space, simplicity of implementation), although not many which strike me as compelling, so relevant background information would be appreciated!