Repository navigation
Description
I'm concerned about the maximum storage need of Staggered File Versioning. If I understand correctly, for the first 1 hour alone a maximum um 120 copies might be kept, and for the first day 24 additional, meaning with only 1 day Maximum Age, one would need to ensure the 144 fold storage space of the synced folder to be save. Otherwise an adversary (human or software e.g. ransomware) can prevent any syncing by flooding the versioned storage.
While I do not doubt that there are use cases where the current setup is ideal and either backed by sufficient storage or the risk is acceptable, I would like to suggest and ask for making the staggered intervals configurable, which would be also in general a welcome increase in flexibility with very limited additional code complexity.
fields to allow configuring interval (i.e. parameterize line 50 to 53 of staggered.go (https://github.com/syncthing/syncthing/blob/main/lib/versioner/staggered.go)
{30, 60 * 60}, // first hour -> 30 sec between versions
{60 * 60, 24 * 60 * 60}, // next day -> 1 h between versions
{24 * 60 * 60, 30 * 24 * 60 * 60}, // next 30 days -> 1 day between versions
{7 * 24 * 60 * 60, maxAge}, // next year -> 1 week between versions
(Users can tune the staggering to their usecase, and syncing needs resulting in e.g.
{15 * 60, 2 * 60 * 60}, //first 2 hours -> 15min between version
{2 * 60 * 60, 24 * 60 * 60} //next day -> 2h between versions,
...
So one would need a input table with two columns and fixed or variable number of rows:
bin | duration
30 | 3600
3600 | 86400
86400 | 2592000
604800 | maxAge
would be the current setup (and then default)
Advantage:
- parameterization should not be to hard and no other changes to the code or test needed
- adjustable usecases, storage and risk settings
This suggestion would also solve #4717
Please consider and many thanks for this great piece of software
Activity
gui, lib/versioner: Allow to configure staggered versioning intervals (…
gui, lib/versioner: Allow to configure staggered versioning intervals (…
ccjmne commentedon Sep 14, 2026
Hey @calmh,
I'm interested in trying my hands at this one :-)
I don't have a lot of experience with Golang, but just going through your
CONTRIBUTING.mdmakes me actually wanna try my best.I'm interested in this feature, and think the UI could be somewhat digestible, if pre-selected with some sane defaults (the current configuration). Otherwise, maybe we could keep "staggered" as it is, and have another entry for "customised staggered" (probably not labelled that, though!)...
In any case, before I jump into it, considering your comment from 2018, I figure I should ask whether you've changed your opinion since then :-)
And if you have, maybe there's some reason you'd wanna share? Maybe you have some idea in mind?
In short:
tomasz1986 commentedon Sep 15, 2026
@ccjmne I had a somewhat working solution in #9094, but then "life happened" and I couldn't finish the PR. You may want to check it out and read the comments made by maintainers and other contributors to see what kind of approach could be used to solve this.