Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
fixed ordering of snapshots with the same creation timestamp #382
Thank you for this. But, correct me if I'm wrong, this only works if you assume that the same instance of sanoid creates all timestamps taken in the same second, right? This is likely but not guaranteed. Wouldn't it make more sense to use a more granular timestamp instead of a counter, ie go down to microsecond timing?
Also - are we certain that none of the regexes parsing out sanoid snapshots are looking for the format without the newly appended utime or counter, and would fail when we do append them?
No, it works regardless. Every timestamp is suffixed internally with "000" when parsing the zfs list output until there are duplicates in which case the counter is used to preserve ordering. (The limit are 1000 snapshots per second) The proper solution would be to retrieve the creation time in millisecond precision but I don't think zfs offers that as far as I found, therefore the workaround with the counter.
I'm not quiet sure what you mean with the regex parsing, the suffixed timestamp is only used internally and never written anywhere/read in.