fix(backup-drill): ignore stale commit-graph, pull from the mirror, guard hot forget #769

Sammanfogat
supernaut sammanfogade 2 incheckningar från fix/backup-drill-fsck-mirror in i main 2026-10-17 21:08:14 +00:00
Ägare

Fixes the two causes of the 2026-10-17 drill failure.

Changes

  • Hot-leg fsck runs with -c core.commitGraph=false. A stale commit-graph after branch deletion no longer fails fsck --connectivity-only.
  • The full hot backup unit gets an ExecCondition that skips the run while bitborg-backup-drill.service is activating or active. The drill is a oneshot, so it is activating for its whole run. Only full runs restic forget, so billing is not guarded.
  • Both restore scripts pull Postgres and Forgejo from the git.bitborg.se mirror and tag them as the upstream ref. A failed mirror pull falls back to upstream. The drill log says which source was used.
  • Runbook: drill step 3 and the hot-leg paragraph.

Tests

scripts/test_backup_guards.py:

  • mirror pull, fallback, and both-pulls-fail
  • the two pull_image copies are identical
  • the guard, run against a stub systemctl: exits 1 for activating and active, 0 for inactive
  • billing unit has no guard
  • fsck carries the flag

After merge

Apply site.yml and run a drill before Sat 2026-10-24. Check the log for "pulled from the mirror" and a green hot leg.

Closes #767
Closes #768

Fixes the two causes of the 2026-10-17 drill failure. ## Changes - Hot-leg fsck runs with `-c core.commitGraph=false`. A stale commit-graph after branch deletion no longer fails `fsck --connectivity-only`. - The `full` hot backup unit gets an `ExecCondition` that skips the run while `bitborg-backup-drill.service` is `activating` or `active`. The drill is a oneshot, so it is `activating` for its whole run. Only `full` runs `restic forget`, so `billing` is not guarded. - Both restore scripts pull Postgres and Forgejo from the `git.bitborg.se` mirror and tag them as the upstream ref. A failed mirror pull falls back to upstream. The drill log says which source was used. - Runbook: drill step 3 and the hot-leg paragraph. ## Tests `scripts/test_backup_guards.py`: - mirror pull, fallback, and both-pulls-fail - the two `pull_image` copies are identical - the guard, run against a stub `systemctl`: exits 1 for `activating` and `active`, 0 for `inactive` - `billing` unit has no guard - fsck carries the flag ## After merge Apply `site.yml` and run a drill before Sat 2026-10-24. Check the log for "pulled from the mirror" and a green hot leg. Closes #767 Closes #768
supernaut lade till 2 incheckningar 2026-10-17 21:02:36 +00:00
Hot-leg fsck runs with core.commitGraph=false, so a stale commit-graph
no longer fails the drill. The VM pulls the Forgejo and Postgres images
from the in-instance mirror and falls back to upstream, logging the
source. The full hot backup unit is skipped while the drill runs, so its
forget cannot delete the snapshot the drill picked.

Closes #767
Closes #768
fix(backup): skip the hot run while the drill is activating
Alla kontroller lyckades
ci / ci (pull_request) Successful in 3m9s
1996bf6c9d
The drill is Type=oneshot, so is-active reports activating (exit 3)
while it runs and the old guard never fired. The guard now matches
active or activating. The mirror pull keeps podman's stderr, and the
tests cover the guard, an all-fail pull and identical pull_image copies.
supernaut sammanfogade incheckning 6aef63c794 till main 2026-10-17 21:08:14 +00:00
supernaut tog bort grenen fix/backup-drill-fsck-mirror 2026-10-17 21:08:14 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra!769
Ingen beskrivning angiven.