Tier-2 engine rework: class-driven legs, v2 layout, NAS-target exclusion (Task 3b, v0.135.0)
tier2_capture.go: classified apps get TierSecondary per-bind legs (paperless copy shrinks — export
drops); legacy apps keep the byte-identical resolver set. v2 relpath-mirroring layout
(backups/secondary/<stack>/{marker LAST, recovery-unit/, hdd/<rel>/, userdata/<rel>/}); N>1 native
(errTier2MultiDir/tier2AppDataName deleted). Migration=delete-and-rebuild + reconcile; all RemoveAll
via tier2SafeRemove (refuses outside backups/secondary/). SSD=state-only tier. selectTier2Target
never picks network storage (pinned+auto, F-6C-1). Restore reads v2 behind a marker gate.
Part 0: offbox_enlarge_blocked is a persisted one-time Load seed (opt-out sticks), not a getter
append. Part 0.5: offsite restore scratch prefers a local (non-network) path.
Full v2 test suite + all 10 §10 red-proofs verified. Destructive writes bounded to backups/secondary/.
This commit is contained in:
@@ -1,5 +1,40 @@
|
||||
## Changelog
|
||||
|
||||
### v0.135.0 — Tier-2 engine rework: class-driven legs, v2 layout, NAS-target exclusion (Task 3b) (2026-07-15)
|
||||
|
||||
Task 3b of the backup-classification-redesign arc — the tier-2 column of the matrix (architecture
|
||||
§2/§8). Behavior-changing but bounded: every destructive write lands ONLY under
|
||||
`backups/secondary/<stack>/` (fully-derived data), asserted in code.
|
||||
|
||||
- **Class-driven appdata leg (`tier2_capture.go`, new):** for a classified app the tier-2 legs are
|
||||
the Task-3-core `TierSecondary` set — per-bind mandatory + optional HDD/userdata paths (paperless's
|
||||
copy legitimately SHRINKS as `export` drops out). Legacy apps keep a byte-identical capture set (the
|
||||
resolver appdata dir(s)) mapped into the same layout. Skipped/missing **mandatory** paths are loud
|
||||
gaps (English log + the app's Hungarian cross-drive `LastWarning`), mirroring the offsite pattern.
|
||||
- **v2 relpath-mirroring layout:** `backups/secondary/<stack>/` = `.felhom-tier2-layout` marker (content
|
||||
"2", written **LAST**) + `recovery-unit/` + `hdd/<relpath>/` + `userdata/<relpath>/`. N>1 appdata dirs
|
||||
and nested binds are represented natively — the v0.131.0 flat-appdata **N>1 refusal is gone**
|
||||
(`errTier2MultiDir`/`tier2AppDataName` deleted). Restore is position-derivable.
|
||||
- **Migration = delete-and-rebuild** (marker absent → remove the old flat `appdata/`; `recovery-unit/`
|
||||
is layout-identical, untouched) + a **reconcile** step that prunes dest dirs a bind no longer covers
|
||||
(a removed/re-classed bind stops occupying the secondary drive within one run). All `os.RemoveAll`
|
||||
goes through `tier2SafeRemove`, which refuses any target not strictly under `backups/secondary/`.
|
||||
- **SSD fallback is an enforced STATE-ONLY tier (§2.2):** headroom is decided on unit + mandatory; the
|
||||
SSD carries unit + mandatory only, optional legs skipped with an honest Hungarian reason.
|
||||
- **NAS-target exclusion (F-6C-1):** `selectTier2Target` never selects a NETWORK storage path — pinned
|
||||
OR auto (metadata-only `IsNetwork()`, no fs probing). NAS-only ⇒ the honest reason
|
||||
("Hálózati tároló nem lehet a 2. mentés célja…"). Prevents the rsync `-og`-under-root_squash
|
||||
silently-wrong-owner restore.
|
||||
- **Restore reads v2 only:** a marker gate refuses a pre-v2 copy ("A 2. mentés régi formátumú…");
|
||||
the reader merges the `hdd/` and `userdata/` subtrees missing-only into live (N>1 native).
|
||||
- **Part 0 — prefs seed fix:** the 3a-fix un-disableable checkbox is fixed — `offbox_enlarge_blocked`
|
||||
is now a ONE-TIME persisted seed at settings Load (`OffboxEnlargeNoticeSeeded`), not a getter append,
|
||||
so a customer's later opt-out **sticks**. **Part 0.5:** the offsite restore scratch now prefers a
|
||||
LOCAL path over a network one (a squashed scratch would feed `PlaceOffsiteRestore` wrong-owner files).
|
||||
- **Tests:** the v2 suite (`tier2_v2_test.go`: A–H + reconcile keep/remove + the safe-remove boundary
|
||||
proof), Part 0 seed tests (idempotent + opt-out-sticks), Part 0.5 scratch-preference tests; obsolete
|
||||
v1 flat-layout / N>1-refusal tests removed. All 10 §10 red-proofs verified (mutate → fail → revert).
|
||||
|
||||
### v0.134.1 — Placement hardening (F-3a-1..4) + enlarge-blocked notification delivery chain (Task 3a-fix) (2026-07-15)
|
||||
|
||||
Follow-up hardening of the (not-yet-live) place-to-live flow from v0.134.0, plus the controller side
|
||||
|
||||
Reference in New Issue
Block a user