filer.backup mirror merges all three collections into one namespace #2

Open
opened 2026-09-30 22:48:40 +00:00 by litelotus · 0 comments
Owner

Problem

filer.backup mirrors paths relative to -filerPath, so the bucket component of the path is dropped. All three collections therefore write into the same destination namespace:

/mnt/hetzner-backup/seaweedfs/<source-mtime-date>/...

Currently:

lanraragi  ->  .../2026-09-24/*.cbz                          (flat)
immich     ->  .../2026-09-24/{thumbs,library,upload,...}/.immich
sftpgo     ->  .../2026-09-24/data/...                       (expected)

Why it matters

  1. Collisions. Nothing prevents sftpgo's data/ or an immich subdirectory name from colliding with another bucket's path. The first writer wins, silently — no error, no log.
  2. Attribution. Once merged, a file cannot be traced back to the bucket it came from. Restoring a single collection means reconstructing the mapping from filenames.
  3. Retention. -retentionDays=30 runs per process against a shared directory, so one collection's retention decisions are not isolated from another's.

Note on the layout

The date component is the source file's mtime, not the backup date. Content therefore spreads across <mirror>/2026-09-23/, 2026-09-24/, … as the watermark advances. Any verification must walk the whole tree; a single ls of one dated directory badly under-reports.

Options

  • Per-collection separation — viable. The sink is chosen from config (findSink(util.GetViper()) in filer_backup.go), not a flag, and the directory is a single global value in replication.toml ([sink.local] directory). But the config search path includes the CWD, so each run ... line could cd into its own directory holding a collection-specific replication.toml with its own directory. Needs the extra configs mounted alongside the existing one.
  • Keep the merge, accept the collision risk, and document a naming convention for the top-level directories.
  • Check upstream for a per-sink or per-path directory override before building the above.

Verify

./verify-filer-backup.sh
## Problem `filer.backup` mirrors paths **relative to `-filerPath`**, so the bucket component of the path is dropped. All three collections therefore write into the same destination namespace: ``` /mnt/hetzner-backup/seaweedfs/<source-mtime-date>/... ``` Currently: ``` lanraragi -> .../2026-09-24/*.cbz (flat) immich -> .../2026-09-24/{thumbs,library,upload,...}/.immich sftpgo -> .../2026-09-24/data/... (expected) ``` ## Why it matters 1. **Collisions.** Nothing prevents sftpgo's `data/` or an immich subdirectory name from colliding with another bucket's path. The first writer wins, silently — no error, no log. 2. **Attribution.** Once merged, a file cannot be traced back to the bucket it came from. Restoring a single collection means reconstructing the mapping from filenames. 3. **Retention.** `-retentionDays=30` runs per process against a shared directory, so one collection's retention decisions are not isolated from another's. ## Note on the layout The date component is the **source file's mtime**, not the backup date. Content therefore spreads across `<mirror>/2026-09-23/`, `2026-09-24/`, … as the watermark advances. Any verification must walk the whole tree; a single `ls` of one dated directory badly under-reports. ## Options - **Per-collection separation — viable.** The sink is chosen from config (`findSink(util.GetViper())` in `filer_backup.go`), not a flag, and the directory is a single global value in `replication.toml` (`[sink.local] directory`). But the config search path includes the **CWD**, so each `run ...` line could `cd` into its own directory holding a collection-specific `replication.toml` with its own `directory`. Needs the extra configs mounted alongside the existing one. - **Keep the merge**, accept the collision risk, and document a naming convention for the top-level directories. - **Check upstream** for a per-sink or per-path directory override before building the above. ## Verify ``` ./verify-filer-backup.sh ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
homelab/seaweed#2
No description provided.