snapshotter

Moving the content index to BLAKE3

2026-11-09 · Why 0.3 stopped trusting size and mtime, and what it cost on a 1-vCPU box.

Up to 0.2, snapshotter decided whether a file changed by comparing size and modification time, the same heuristic rsync uses by default. It is fast and it is wrong often enough to matter: a restored backup, a touch in a deploy script or a tool that preserves mtimes on rewrite all fool it.

0.3 keeps a content index: one BLAKE3 hash per file, stored next to each snapshot. A file is linked to the previous snapshot only if the hash matches. Renamed and moved files are found by hash too, so reorganising /var/www no longer doubles the repository.

What it costs

SourceFilessize+mtimeBLAKE3, coldBLAKE3, warm
/etc1 9120.2 s0.6 s0.3 s
/var/www (blog + photos)18 4401.1 s21 s2.4 s
/home (one user)61 0073.8 s74 s7.9 s

"Warm" means files whose size and mtime did not change are trusted and not re-hashed, with a full re-hash every seventh run. That keeps hourly snapshots cheap and still catches the cases the old heuristic missed.