Detect ZFS snapshot name collision, append unique identifier #2
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:Add option to include a unique identifier in snapshot names for example like so:
This should
_1,_2etc.)snap_field_separatorsetting which defaults to the underscore character (_) viasnap_field_separator='_'pacman-zfs-snapshot.confand our mainREADME.mdthat when this gets toggled off and a naming collision does happen because of it the snapshot will not be done and instead any ongoingpacmantransaction will abortpacmanaction is getting canceled because of the collision and how to fix this.zfs listin 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
pacmanoperations 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.