Logarithmically-Spaced Snapshots (2022)
madebyevan.com
Logarithmically-Spaced Snapshots (2022)
1–10 of 16 posts
Re: Logarithmically-Spaced Snapshots (2022)
#2Re: Logarithmically-Spaced Snapshots (2022)
#3- how long ago you need blocks for preventing alternate-history shenanigans
- how long ago you need blocks for nodes that may go offline for a while and come back confused
- how long ago you need fine granularity of records for accounting reasons
If none of those timespans are "forever" then maybe there could be agreement between nodes that at some point we start summarizing. So instead of deleting snapshots, you're merging adjacent blocks and purging transitional states that are not required to tell a consistent story.
Re: Logarithmically-Spaced Snapshots (2022)
#4Re: Logarithmically-Spaced Snapshots (2022)
#5Maybe not hard to get a deterministically good distribution (haven't properly read TFA) but I guess you'd be sad if you didn't do better than the most obvious thing.
I guess also an algorithm like "delete the (i mod n)th oldest element once you hit the capacity" also deletes every second element every n iterations, though maybe a bit uneven as it prefers to thin things out in quite local ways.
Re: Logarithmically-Spaced Snapshots (2022)
#6Use case: I already have a list of equally spaced snapshots that I'd like to logarithmically space.
Also, it occurs to me that this (and other grandfather snapshot schemes) ultimately derive from the generational hypothesis: users want files for either a short time (transient files, tarballs, PDFs, checkouts) or a long time (photos).
Re: Logarithmically-Spaced Snapshots (2022)
#7Is there a similarly simple scheme that works even if you decouple the snapshot phase from the GC phase. Use case: I already have a list of equally spaced snapshots that I'd like to logarithmically space. Also, it occurs to me that this (and other grandfather snapshot schemes) ultimately derive from the generational hypothesis: users want files for either a short time (transient files, tarballs, PDFs, checkouts) or a…
- Start with the most recent snapshot; keep it
- Go on to the next snapshot; keep it, and then drop the next 2^1 - 1 = 1 snapshot
- Go on to the next snapshot; keep it, and then drop the next 2^2 - 1 = 3 snapshots
- Go on to the next snapshot; keep it, and then drop the next 2^3 - 1 = 7 snapshots
Etc.
Alternately (if it's easier to model or implement it thus), the snapshots that you keep are the ones at power-of-two indices, plus 0 (starting again from the most recent snapshot): snapshot 0, snapshot 1, snapshot 2, snapshot 4...
Re: Logarithmically-Spaced Snapshots (2022)
#8Every day there is exactly one date for which a snapshot needs to be deleted and it can be computed directly. If there is no snapshot for this date nothing needs to be done.
Re: Logarithmically-Spaced Snapshots (2022)
#9this is a very nice family of structures; perhaps you could use it to choose which previous line in a poem to rhyme with, or which previous day to reflect on
(...GCAABBCDEEFFDG... might be interesting to write with the quatrains displayed block inline but the longer-range rhymes just set as normal prose; it would be up to the reader to notice the maintenance of metre and rhyme in the nominally "prose" sections)
Re: Logarithmically-Spaced Snapshots (2022)
#10What exactly is being optimized under what constraints and why log spacing is a solution ?