Conversation
|
Can't wait! this should really help with window's previous versions and samba |
|
@kennypm this looks really good. It should preserve the default behaviour nicely and everyone can adapt the format in a very flexible way. I still need to run the tests in a vm to make sure it works and will report back. |
|
Well, yes, but I do have to wonder if it's quite the best way forward. Wouldn't it be better to abandon "recognizing" snapshots by name format at all, and instead begin recognizing them either by the original, default naming format or by setting a custom ZFS property when sanoid (or syncoid!) takes a snapshot? That way we can make our sweeping change now, Sanoid will not only let people change the naming format but will keep working on all existing snapshots even after a naming format change, etc. Eventually, we can consider dropping name-based detection support at all, and rely purely on the custom ZFS property (or properties, there's probably a lot we could be doing with those if we put our minds to it). What do y'all think? |
|
@kennypm Running the tests I get the following on the first run of sanoid: |
|
When I updated to v2.3.0, my patch broke and I never bothered rebasing the branch due to the lack of movement here at that point. I'll gladly do the work of fixing it up if we can come to consensus on the underlying mechanism as @jimsalterjrs discussed above. I remember being a little surprised as I was developing the feature that it was relying on pattern matching of snapshot names, so I guess my vote would be for a ZFS property for the sake of robustness. |
Even if we use a custom property for more flexibility in the future it would still be very helpful to define the snapshot naming format for human readable snapshot lists in the filesystem, for samba's shadow_copy2 module, ... .
I think dropping name based detection support is not a good idea because it will probably create some issues:
|
custom datestamp format no name reordering yet as getsnaps() expects leading prefix and trailing snap type
|
+1 Looking forward to this patch! |
This should address everyone's requests from #552, succinctly summed up by @ams-tschoening:
The new properties can be overridden for child datasets if the parent uses
recursive = yes. I've tested a few different configurations and everything seems to be working as expected. The first commit here covers everything except reordering the substrings with a user-defined template.I separated that into a second commit since it requires more invasive changes to
getsnaps(). The old behavior expects snap names to start withautosnapand end with a*lytype. The new behavior recognizes sanoid autosnaps as long as the name contains both a*lytype and whatever identifier string the dataset is configured to use, which defaults toautosnap.There is currently no tracking of old identifier labels after they've been changed, but the only person who mentioned that possibility said they didn't need it.