From bfc57cfaa02f584d3a937707297f193ae44f3507 Mon Sep 17 00:00:00 2001 From: vickeykumar Date: Sat, 14 Nov 2026 17:17:16 +0530 Subject: [PATCH] Log every snapshot that is made, with the old day archives and versions the bucket cleanup removed Co-Authored-By: Claude Sonnet 5.5 --- docs/lld/15-object-storage.md | 2 +- src/homesnap/snapper.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/lld/15-object-storage.md b/docs/lld/15-object-storage.md index 1af03659..5a5d3944 100644 --- a/docs/lld/15-object-storage.md +++ b/docs/lld/15-object-storage.md @@ -36,7 +36,7 @@ A client with the standard library only (like `persist/firestore.go`): AWS Signa - **Who:** the node that is the authority for a home: a single server, or the gateway (which holds a copy of every home, LLD 12). Never a worker (`homesnap.Default.Enable()` is not called in worker mode; workers have no keys). Only signed-in users' homes: `guest-*` are never kept. - **Registered by use:** `touchHome` (`server/identity.go`) and the gateway's `PrepareHome` call `Touch(home)` when a signed-in user's request resolves its home. The first time a home is touched in a process: if its folder is missing or empty it is restored (below); from then on it is followed. A home that nobody touches is not asked about again. - **Snapshot (`SnapshotHome`):** a job every 5 minutes snapshots the followed homes whose fingerprint changed and in which nothing was written for 30 seconds; at a clean stop every changed home, without waiting. A snapshot holds plain files and folders (empty ones too), never a link, a socket or anything named `.wsync-*`; a file over 50 MB, or one that changes while it is read, is left out and noted in the manifest; a home over 100 MB is not snapshotted (an error in the job's result). -- **Storage (changed 2026-11-13):** one object for each UTC day, `homes///-.tar.gz` (`daily.go`), overwritten by every snapshot of that day (metadata: `sha256`, `generation`, `created`), and `latest.json` (generation, key, SHA-256, writer). The newest 3 days are kept (`Keep`). Where the bucket keeps versions (Backblaze B2 does, R2 does not), the older versions of a day's file stay in the bucket until its lifecycle rule removes them, and the profile page lists them (`objstore.ListVersions`, `GetVersion`). Objects of the earlier scheme (`-