Detect ZFS snapshot name collision, append unique identifier #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current implementation in branch "1-get-base-version-going" will happily try to create a ZFS snapshot with the exact same name as a prior one:
pacman -S package
) twice for example when installing or reinstalling a packagesnap_date_format='%F-%H%M'
where snapshots take this form: Two installations (or reinstallations) for example within the same minute done for the same set of packages will cause a ZFS snapshot name collission and uncleanly fail.Add option to include a unique identifier in snapshot names for example like so:
This should
_1
,_2
etc.)snap_field_separator
setting which defaults to the underscore character (_
) viasnap_field_separator='_'
pacman-zfs-snapshot.conf
and our mainREADME.md
that when this gets toggled off and a naming collision does happen because of it the snapshot will not be done and instead any ongoingpacman
transaction will abortpacman
action is getting canceled because of the collision and how to fix this.zfs list
in README.md that shows the suffix in action.Won't fix. Thought about this and decided that simply skipping these otherwise identical snapshots is more straightforward.
The rationale is that user's doing the exact same operation twice or more. There's most likely no reasonable expectaion that their operating system enters a different state on successive
pacman
operations so there's no need to deal with multiple snapshots capturing the same state.On second thought this approach does sound safer. It takes away any and all uncertainty from the user about whether or not snapshots are created.