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

Versioner file tagging is inconsistent #4586

Closed
AudriusButkevicius opened this issue Dec 10, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@AudriusButkevicius
Copy link
Member

commented Dec 10, 2017

Simple uses file.ModTime(), staggered uses time.Now().

@calmh

This comment has been minimized.

Copy link
Member

commented Dec 11, 2017

I think this is intentional. Simple just keeps a number of versions, and names them based on when the file was modified. Staggered tracks when the versions were created so it can keep x amount of them in a certain time interval etc.

@AudriusButkevicius

This comment has been minimized.

Copy link
Member Author

commented Dec 11, 2017

Sure, but for purposes of restoring, it's confusing and not obvious that/why it differs.

@calmh calmh added the enhancement label Dec 25, 2017

@calmh calmh added this to the Unplanned (Contributions Welcome) milestone Dec 25, 2017

@calmh calmh removed this from the Unplanned (Contributions Welcome) milestone Feb 11, 2018

AudriusButkevicius added a commit to AudriusButkevicius/syncthing that referenced this issue Feb 6, 2019

lib/versioner: Restore for all versioners, cross-device support
Fixes syncthing#4631
Fixes syncthing#4586
Fixes syncthing#1634
Fixes syncthing#5338
Fixes syncthing#5419

This also:
1. Forces all versioners to use the same tagging, meaning that trash can versioner will start adding timestamps (cleanup is mtime based so it's ok)
2. Removes Rename function which seems not to be used anywhere important anymore, and TryRename is now RenameOrCopy
3. Versioning (and ton of other stuff) should now happen across filesystems when possible.
4. Adds versioning support for untagged and old file.txt~2014... tagged files. (There was no other way, in order to support trashcan versioner)

AudriusButkevicius added a commit that referenced this issue Apr 28, 2019

lib/versioner: Restore for all versioners, cross-device support (#5514)
* lib/versioner: Restore for all versioners, cross-device support

Fixes #4631
Fixes #4586
Fixes #1634
Fixes #5338
Fixes #5419

@calmh calmh added this to the v1.1.3 milestone Apr 29, 2019

@calmh

This comment has been minimized.

Copy link
Member

commented May 10, 2019

So for clarity for future readers (because I had to go looking) we now always use the existing file modtime for the timestamp in the version name.

@calmh

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

This was changed in v1.2.0, so that the timestamp in the name is when we archived the file; the mtime is unchanged.

The trashcan versioner doesn’t alter the name, so instead it does change the mtime to when we archived the file. This inconsistency will persist.

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.