07 §6.6 which version a restore brings back; version-travel evidence (A1, A5 red-proofs + live, A7, D1-D4); R-698 filed
gates / gates (push) Successful in 27s

This commit is contained in:
admin committed 2026-09-27 11:29:30 +02:00
1 parent af6db38514
commit bff98a81a2
46 files changed
+4494 -1

No files matched your search

@@ -584,6 +584,64 @@ a folder its app owns with mode 0770 (nextcloud, `www-data`) — R-691.
Evidence: `audits/night-2026-09-26/E/` (E1 spike, E5 live proof).
### 6.6 Which version a restore brings back (controller v0.275.0, R-696, D4 option A)
**[DESIGN] The rule: a restore brings an app back at the version its DATA belongs to — never the data of
one version under the definition of another.** When the only copy holds data written by an older version,
the app comes back at that older version with its own data, and the normal guarded update then climbs the
ladder again, one tested step at a time (`09` §3 decision 14). The household's first sentence says so:
„A(z) %s visszaállt a(z) %s-i mentésből, a(z) %s verzióra. Elérhető frissítés: a doboz lépésenként hozza
naprakészre." / "%s is back from the backup of %s, at version %s. An update is available: the box brings it
up to date one step at a time." The version is every image as `name:tag` — a PostgreSQL step leaves the
app's own tag unchanged. D4 option B (restore into a temporary copy, update it there, move the data in) is
NOT built; it would be an add-on to this rule, not a replacement. *D4 is recorded in `STATUS.md`; until it is
ruled, A is in force.*
**[FACT] Why, measured before the fix (9202, 2026-09-26, `audits/version-travel-2026-09-26/A1/`).** The unit's
definition (`compose/`, `image_pins`) was re-captured by the five-minute status refresh as soon as an update
moved the pin, while its data (`db-dumps/`, `volume-dumps/`) is written only by the backup legs — so for up to
a day the unit paired the new definition with the old data. An app step (docmost 0.95.0 → 0.96.0) restored in
that window came back only because docmost migrated the old data forward at its first start — an update step
nobody guarded. An engine step (PostgreSQL 16 → 18) restored in that window poured the 16 datadir back,
`postgres:18` refused it, and **the app was left down**. The off-site restore never wrote a definition at all,
so after any update it mixed versions until the next night's off-site run.
**[DESIGN] How the data carries its version.** Every data file a backup leg writes (the database dump, each
volume tar) gets a stamp at the moment it is written — its size and mtime, the definition's image pins, and
what each service was running as `ref@digest` (`data-stamps.json` in the unit). The unit capture folds the
stamps into the manifest's `data` block (`at`, `image_pins`, `images`, per-file stamps) and **keeps the
definition its data belongs to**: when the pins moved since the data was written, `compose/` is not rewritten
until the next data run replaces the data. The manifest's `image_pins` stays the app's current pins, so it says
both. Files written under different pins (a failed leg) make the unit `mixed`.
**[DESIGN] What each restore does with it.**
| path | the unit's `data` block | what happens |
|---|---|---|
| own unit (Tier 1), second-drive mirror (Tier 2), kept-data Load | present, `compose/` names the data's pins | the data starts under that definition; if it differs from what ran, the restore pages' first sentence names the backup and the version (the kept-data Load has its own sentence and does not add this one) |
| same | present, `compose/` names OTHER pins, or `mixed` | **refused before anything is touched** (`ErrUnitVersionMismatch`): „…ezért a visszaállítás nem indult el. Az alkalmazás érintetlen" |
| off-site (Tier 3) | present, the snapshot's version differs from what runs | the snapshot unit's definition is written into the stack dir (and pinned) right after the stop, before any file, volume or database is touched; the database service is resolved from it |
| any | absent — a unit or snapshot written before v0.275.0, or with an unstamped file | restores **as before** (its captured definition; the off-site path the live one), with a WARN naming it |
**[DESIGN] The jump guard.** An installed version that matches no ladder entry's `from` jumps to the catalog's
current definition when a PERSON presses Update (`ladder.go`, measured live on vikunja 2.5.0, `09` §6.4 part 5);
the AUTOMATIC leg never presses it (`LegSkipOlderThanLadder`, and a template without a ladder is
`LegSkipNoTestRecord`). So a restore to a version older than the ladder — or of an app with no ladder — gets
the other first sentence: „…Ettől a verziótól nem vezet kipróbált frissítési lépés, ezért a doboz magától nem
frissíti." / "…No tested update step leads on from this version, so the box does not update it by itself." A
jump is not a tested step, and the page does not promise one.
**[DESIGN] The times tell the truth (A4).** Every tier's "proven at" is the time of its DATA, never of a
manifest: Tier 1 = `data.at` (else the newest data file, the `pre-restore-*` undo copies excluded, else — for a
unit with no data file — the manifest); Tier 2 = the mirror's data time, capped by its copy time; Tier 3 = the
snapshot time, capped by the data time the box recorded when it pushed it (`settings.offsite_data_at`). The
update's precondition and the release of a kept pre-conversion copy read these times; the release additionally
requires a database dump written after the conversion whose recorded engine is the NEW major.
**[FACT] The limit — the image is not in the backup (R-698).** A unit stores image NAMES and digests; the
image is re-pulled on restore. A version its maker has deleted cannot start. Measured 2026-09-26: the 42 ladder
digests all resolve today (`audits/version-travel-2026-09-26/A7/`). Options are in R-698; nothing is decided.
## 7. The recovery chain (D3) — the reason this document exists
**[DESIGN] 3-2-1 describes copies. It does not describe recovery.**