Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed ordering of snapshots with the same creation timestamp #382

Merged
merged 1 commit into from May 15, 2019

Conversation

Projects
None yet
2 participants
@phreaker0
Copy link
Collaborator

commented May 15, 2019

Fixes #381

@jimsalterjrs

This comment has been minimized.

Copy link
Owner

commented May 15, 2019

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?

@phreaker0

This comment has been minimized.

Copy link
Collaborator Author

commented May 15, 2019

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.

@jimsalterjrs

This comment has been minimized.

Copy link
Owner

commented May 15, 2019

Oh, okay - I misunderstood the impact. Thanks for explaining!

@jimsalterjrs jimsalterjrs merged commit e320462 into jimsalterjrs:master May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.