Data-loss hunt: R-1185 proven (an invalid dump replaces the good one, no error); R-1182 confirmed in code; DST replay of the controller scheduler (once each on 25 Oct; spring 02:30 dump collides with the 03:30 copy)
gates / gates (push) Successful in 13m44s
gates / gates (push) Successful in 13m44s
This commit is contained in:
1 parent
20a77d367b
commit
a942ae90d6
7 files changed
+117
-5
No files matched your search
@@ -16,7 +16,7 @@ Register: none of the candidates below is in OPEN-ITEMS or CLOSED-ITEMS (searche
|
||||
| **D1** shares second-drive copy pruned by another drive's group | **CONFIRMED** (unit test, production code, fake mirror seam — `C3-D1-shares-tier2/`) | defect | **Worse than reported:** with shares on two drives that pick the same target, EVERY night the second group's reconcile deletes the first group's copy (`removed stale dest dir hdd_2/b_share`) — one drive's shares never have a second copy while the run says ok. And the night a drive goes away, its copy is deleted (`removed stale dest dir hdd_3/csaladi_fotok`). |
|
||||
| D1b an AWAY drive is still chosen as the second-drive target | CONFIRMED-CODE (+ the same unit test: `hdd_3/iskola => hdd_1/...` after hdd_1 was marked disconnected) | defect | `tier2.go:151-180` loops `GetSchedulableStoragePaths()` (`settings.go:1593-1603` excludes only Decommissioned); no Disconnected check. On a real box the away drive's empty mount point is on the guest's root disk |
|
||||
| **K1** reinstall after „delete the old host" loses the route to the old escrow | **CONFIRMED** at the hub store (unit test against production code, `C3-K1-escrow-after-host-delete/`); the controller half (new key minted, history set aside on night one) CONFIRMED-CODE | defect (03 §8a / 07 §7.0 promise the route; D19+R-1154 removed it unrecorded) | hub `store.go:3164-3229` demotes into `host_escrow_superseded` under the OLD host_id and deletes the `hosts` row; `GetEscrowStatusForCustomer` `store.go:3499-3527` joins on `hosts` → nil for the new box; `customer_reset.go:48,155` and `store.go:4189` DO include `host_deletions`. Live proof needs Tester4 off-site ON (B7) |
|
||||
| K2 abandoning one set-aside copy purges every retained package | PLAUSIBLE | defect (breaks `store.go:4176-4179`'s own invariant) | `store.go:4185-4190` customer-wide delete read true |
|
||||
| K2 abandoning one set-aside copy purges every retained package | CONFIRMED-CODE (`store.go:4185-4190`) → R-1182 | defect (breaks `store.go:4176-4179`'s own invariant) | `store.go:4185-4190` customer-wide delete read true |
|
||||
| **R1/D4** a failed LOCAL unit restore: no copy of the live state, app started anyway | **CONFIRMED LIVE** on 9202 (`C3-R1-local-restore-9202/`): live row destroyed, DB crash-loops, no undo copy, raw English Docker text to the household | **design question** for the operator: decision 154 (R-638 A) chose „start anyway"; D20 (R-893 A) gave „put back exactly" to the OFF-SITE path only | `restore_unit.go:428-489` |
|
||||
| R2 a crash mid-restore starts the app on a mixed state; the undo copy is never read at start | PLAUSIBLE | defect | `appstop_marker.go:307`, `offbox_restore_undo.go:137` |
|
||||
| R3 a cut-off shares restore can be placed and reported restored | CONFIRMED-CODE | defect (R-358 class, fixed for apps, not shares) | `shares_restore.go:131-140` readiness = non-empty dir |
|
||||
@@ -29,7 +29,7 @@ Register: none of the candidates below is in OPEN-ITEMS or CLOSED-ITEMS (searche
|
||||
| R12 interrupted whole restore leaves `*.felhom-restoring`, every retry fails | CONFIRMED-CODE | defect | `tier2_whole.go:86-87` O_EXCL; removed only on an in-process error |
|
||||
| **D2** a missing / emptied app folder deletes its second-drive copy within one night | **CONFIRMED** for a MISSING folder (unit test, production code + real copy seam: `C3-D2-missing-leg/` — mirror of `photos` deleted, run „ok", the warning says only „nem kerültek a másodlagos mentésbe"); the EMPTIED case CONFIRMED-CODE (`rsyncMirror` = `rsync -a --delete`, `tier2.go:744-751`; the test seam does not delete) | defect-shaped corner of a choice: 07 §8.2 „data legs are NOT guarded" is about a leg LEAVING the class set; this is a declared leg that is MISSING, which the code itself logs as a gap (`tier2_capture.go:55-61`) and then reconciles away (`tier2.go:454`) | P1 for optional legs (no other tier holds them) |
|
||||
| D3 / T11 a host clock ahead silences the whole-guest tier; the hub reads the same clock | PLAUSIBLE (B6 #8 on the rehearsal VM is its live test) | defect | agent `localapi/server.go:1178-1190` |
|
||||
| D5 a dump that fails its own check has already replaced the good one | CONFIRMED-CODE | defect for the ORDER | `appbackup/dbdump.go:388-422`: size check, rename (`:399`), then `ValidateDump` |
|
||||
| D5 a dump that fails its own check has already replaced the good one | **CONFIRMED** (unit test with a docker stub: `C3-D5-dump-replaced/`) → R-1185 | defect for the ORDER | `appbackup/dbdump.go:388-422`: size check, rename (`:399`), then `ValidateDump` |
|
||||
| D6 kept-data page can list a running app's folder | PLAUSIBLE | defect | needs an unreadable app.yaml |
|
||||
| D7 unit restore can point the app at an old drive | PLAUSIBLE (low) | defect | |
|
||||
| D8 local whole-guest keep=1 | design (07 §6.1 R-684 chose it) | design | **NOT-A-FINDING: the operator chose keep=1 for demo-hp; recorded in 07** |
|
||||
@@ -37,7 +37,7 @@ Register: none of the candidates below is in OPEN-ITEMS or CLOSED-ITEMS (searche
|
||||
| T2 controller image without tzdata → UTC schedules | **NOT-A-FINDING:** measured on 9202 (controller 0.331.0, Debian 13 base): `/usr/share/zoneinfo/Europe/Budapest` present, scheduler logs „scheduled for … CEST" | — | |
|
||||
| T3 whole-guest start creeps ~5 min/night | PLAUSIBLE | defect | needs the agent journal over weeks |
|
||||
| T4 whole-guest quiesce stops apps mid-restore | PLAUSIBLE | defect | `quiesce.go:213-275` |
|
||||
| T5 nightly off-site copy skipped SILENTLY when the flag is held; catch-up never retries | CONFIRMED-CODE | defect (the code chose nil for the nightly path; the catch-up gap is not chosen) | `offbox.go:981-996`, `main.go:1246` |
|
||||
| T5 nightly off-site copy skipped SILENTLY when the flag is held; catch-up never retries | CONFIRMED-CODE → R-1186 | defect (the code chose nil for the nightly path; the catch-up gap is not chosen) | `offbox.go:981-996`, `main.go:1246` |
|
||||
| T6 proof / integrity never run on a box off at 05:30–06:00 | PLAUSIBLE | defect (comment `main.go:1575-1577` says the opposite) | |
|
||||
| T7 hub false „no DB dump" for late or evening W | PLAUSIBLE | defect | hub `monitor/deadline.go:416-419, 556-565` |
|
||||
| T8 the OS leg follows a daytime valve backup | design question | design | 07 §6.1 / 11 §8.1 set no time bound |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# go test at controller 7ca59e2 (v0.336.0), scratch clone; a docker STUB on PATH (no real docker reached); 2026-10-20T11:07:38Z
|
||||
=== RUN TestRehearsalD5_InvalidDumpReplacesTheGoodOne
|
||||
zz_rehearsal_d5_test.go:26: POSITIVE CONTROL: last night's dump, 152 B, ValidateDump={Valid:true TableCount:1 Error: FileSize:152 ModTime:2026-10-20 13:07:39.022566077 +0200 CEST UserTableFound:false UserRows:0 LooksEmpty:false}
|
||||
2026/10/20 13:07:39 [WARN] [backup] ValidateDump FAIL: /tmp/TestRehearsalD5_InvalidDumpReplacesTheGoodOne2769942191/002/unit/app-postgres.sql — dump file too small (< 100 bytes)
|
||||
zz_rehearsal_d5_test.go:31: tonight's dump: err=<nil> validation={Valid:false TableCount:0 Error:dump file too small (< 100 bytes) FileSize:99 ModTime:2026-10-20 13:07:39.026566071 +0200 CEST UserTableFound:false UserRows:0 LooksEmpty:false}
|
||||
zz_rehearsal_d5_test.go:32: FAULT: the file on disk now = 99 B, still holds CREATE TABLE photos: false
|
||||
--- PASS: TestRehearsalD5_InvalidDumpReplacesTheGoodOne (0.00s)
|
||||
PASS
|
||||
ok gitea.dooplex.hu/admin/felhom-controller/internal/appbackup 0.008s
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package appbackup
|
||||
|
||||
// THROWAWAY proof for the 2026-10-20 data-loss hunt (candidate D5 / R-1185). Never committed. A docker STUB on PATH
|
||||
// (no real docker is reached) prints a header-only dump, as a database that was re-initialised empty would.
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRehearsalD5_InvalidDumpReplacesTheGoodOne(t *testing.T) {
|
||||
bin := t.TempDir()
|
||||
stub := "#!/bin/sh\ncase \"$1\" in\n inspect) echo true ;;\n exec) printf -- '-- PostgreSQL database dump\\nSET statement_timeout = 0;\\n\\n--\\n-- PostgreSQL database dump complete\\n--\\n' ;;\nesac\n"
|
||||
if err := os.WriteFile(filepath.Join(bin, "docker"), []byte(stub), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Setenv("PATH", bin)
|
||||
dumpDir := filepath.Join(t.TempDir(), "unit")
|
||||
final := filepath.Join(dumpDir, "app-postgres.sql")
|
||||
good := "-- PostgreSQL database dump\nCREATE TABLE public.photos (id int);\nCOPY public.photos (id) FROM stdin;\n1\n2\n\\.\n\n--\n-- PostgreSQL database dump complete\n--\n"
|
||||
os.MkdirAll(dumpDir, 0o755)
|
||||
os.WriteFile(final, []byte(good), 0o644)
|
||||
t.Logf("POSITIVE CONTROL: last night's dump, %d B, ValidateDump=%+v", len(good), ValidateDump(final, DBTypePostgres))
|
||||
|
||||
db := DiscoveredDB{ContainerName: "app-db", ContainerID: "0123456789abcdef", DBType: DBTypePostgres, DBUser: "u", DBName: "d", StackName: "app"}
|
||||
res := DumpOneTo(context.Background(), db, final, log.New(io.Discard, "", 0), false)
|
||||
b, _ := os.ReadFile(final)
|
||||
t.Logf("tonight's dump: err=%v validation=%+v", res.Error, res.Validation)
|
||||
t.Logf("FAULT: the file on disk now = %d B, still holds CREATE TABLE photos: %v", len(b), contains(string(b), "CREATE TABLE public.photos"))
|
||||
}
|
||||
|
||||
func contains(s, sub string) bool { return len(s) >= len(sub) && (func() bool { for i := 0; i+len(sub) <= len(s); i++ { if s[i:i+len(sub)] == sub { return true } }; return false })() }
|
||||
@@ -0,0 +1,16 @@
|
||||
# DST — what each scheduler does on Sunday 2026-10-25 (03:00 CEST → 02:00 CET), read from code and replayed
|
||||
|
||||
No architecture document mentions DST (`07` has no hit for DST, daylight or timezone — checked again 2026-10-20 with
|
||||
ASCII fragments `DST`, `daylight`, `time.?zone`, `ora.?allit`; positive control: `Europe/Budapest` is found in 07).
|
||||
|
||||
| scheduler | 2026-10-25 | 2027-03-28 (spring) | how known |
|
||||
|---|---|---|---|
|
||||
| controller `sched.Daily` (db-dump W, second copy W+60, off-site W+105, fill-watch, metrics, asset-sync, abandon-sweep, proof, integrity) | **once each**; a 02:xx time runs at the SECOND (CET) occurrence | a 02:xx time runs at 03:xx CEST — **the default 02:30 dump lands on 03:30, the same instant as the 03:30 second-drive copy** | PRODUCTION `nextDailyRunAt` replayed (`replay.txt`) |
|
||||
| hub `scheduleDaily` (db-snapshot 02:00, prune 04:30, deadline-check 05:00, key-audit 07:10) | **TWICE** — e.g. the alarm check at 04:00 CET and 05:00 CET | once each, one hour late | the hub's arithmetic replayed (`../../../dataloss-hunt-2026-10-20/C3-T9-hub-dst/replay.txt`) → **R-1183** |
|
||||
| agent (whole-guest due, restore-test, OS leg, cap) | unaffected (UTC durations) | unaffected | code read (C1 reviewer 4) |
|
||||
| controller quiesce gate [W+2h, W+6h) by wall minute | 04:30–08:30 CET for W = 02:30 (4 h real) | 04:30–08:30 CEST | code read |
|
||||
| host timers on a household box | monotonic only | monotonic only | code read |
|
||||
| DooPlex timers | Oct 25 is a Sunday: both weekly restore tests run on the DST day; the 02:30 hub-db-backup timer is inside the repeated hour — not verified | — | code read |
|
||||
|
||||
The live check of the box itself (B6 #7: the rehearsal VM's clock set to 2026-10-25 01:30 CEST and run to 04:00 CET)
|
||||
is recorded separately when it runs.
|
||||
@@ -0,0 +1,25 @@
|
||||
# controller 7ca59e2 (v0.336.0) scheduler.nextDailyRunAt replayed; go version go1.27.2 linux/amd64; 2026-10-20T11:06:36Z
|
||||
=== RUN TestRehearsalDST_ControllerDailyTimes
|
||||
zz_rehearsal_dst_test.go:24: 02:00: 10-25 02:00 CET(01:00Z) 10-26 02:00 CET(01:00Z) 10-27 02:00 CET(01:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:15: 10-25 02:15 CET(01:15Z) 10-26 02:15 CET(01:15Z) 10-27 02:15 CET(01:15Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:30: 10-25 02:30 CET(01:30Z) 10-26 02:30 CET(01:30Z) 10-27 02:30 CET(01:30Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:59: 10-25 02:59 CET(01:59Z) 10-26 02:59 CET(01:59Z) 10-27 02:59 CET(01:59Z)
|
||||
zz_rehearsal_dst_test.go:24: 03:00: 10-25 03:00 CET(02:00Z) 10-26 03:00 CET(02:00Z) 10-27 03:00 CET(02:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 03:30: 10-25 03:30 CET(02:30Z) 10-26 03:30 CET(02:30Z) 10-27 03:30 CET(02:30Z)
|
||||
zz_rehearsal_dst_test.go:24: 04:15: 10-25 04:15 CET(03:15Z) 10-26 04:15 CET(03:15Z) 10-27 04:15 CET(03:15Z)
|
||||
zz_rehearsal_dst_test.go:24: 05:30: 10-25 05:30 CET(04:30Z) 10-26 05:30 CET(04:30Z) 10-27 05:30 CET(04:30Z)
|
||||
zz_rehearsal_dst_test.go:24: 06:00: 10-25 06:00 CET(05:00Z) 10-26 06:00 CET(05:00Z) 10-27 06:00 CET(05:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 22:00: 10-24 22:00 CEST(20:00Z) 10-25 22:00 CET(21:00Z) 10-26 22:00 CET(21:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:00: 03-28 03:00 CEST(01:00Z) 03-29 02:00 CEST(00:00Z) 03-30 02:00 CEST(00:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:15: 03-28 03:15 CEST(01:15Z) 03-29 02:15 CEST(00:15Z) 03-30 02:15 CEST(00:15Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:30: 03-28 03:30 CEST(01:30Z) 03-29 02:30 CEST(00:30Z) 03-30 02:30 CEST(00:30Z)
|
||||
zz_rehearsal_dst_test.go:24: 02:59: 03-28 03:59 CEST(01:59Z) 03-29 02:59 CEST(00:59Z) 03-30 02:59 CEST(00:59Z)
|
||||
zz_rehearsal_dst_test.go:24: 03:00: 03-28 03:00 CEST(01:00Z) 03-29 03:00 CEST(01:00Z) 03-30 03:00 CEST(01:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 03:30: 03-28 03:30 CEST(01:30Z) 03-29 03:30 CEST(01:30Z) 03-30 03:30 CEST(01:30Z)
|
||||
zz_rehearsal_dst_test.go:24: 04:15: 03-28 04:15 CEST(02:15Z) 03-29 04:15 CEST(02:15Z) 03-30 04:15 CEST(02:15Z)
|
||||
zz_rehearsal_dst_test.go:24: 05:30: 03-28 05:30 CEST(03:30Z) 03-29 05:30 CEST(03:30Z) 03-30 05:30 CEST(03:30Z)
|
||||
zz_rehearsal_dst_test.go:24: 06:00: 03-28 06:00 CEST(04:00Z) 03-29 06:00 CEST(04:00Z) 03-30 06:00 CEST(04:00Z)
|
||||
zz_rehearsal_dst_test.go:24: 22:00: 03-27 22:00 CET(21:00Z) 03-28 22:00 CEST(20:00Z) 03-29 22:00 CEST(20:00Z)
|
||||
--- PASS: TestRehearsalDST_ControllerDailyTimes (0.00s)
|
||||
PASS
|
||||
ok gitea.dooplex.hu/admin/felhom-controller/internal/scheduler 0.004s
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package scheduler
|
||||
|
||||
// THROWAWAY replay for the 2026-10-20 rehearsal (B6 #7, DST) — never committed. Replays the PRODUCTION
|
||||
// nextDailyRunAt over the two DST changes for every controller daily time; the loop re-reads the clock at each
|
||||
// fire instant exactly as the scheduler does.
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRehearsalDST_ControllerDailyTimes(t *testing.T) {
|
||||
loc := getBudapestLocation()
|
||||
for _, win := range []struct{ from, to time.Time }{
|
||||
{time.Date(2026, 10, 24, 12, 0, 0, 0, loc), time.Date(2026, 10, 26, 12, 0, 0, 0, loc)},
|
||||
{time.Date(2027, 3, 27, 12, 0, 0, 0, loc), time.Date(2027, 3, 29, 12, 0, 0, 0, loc)},
|
||||
} {
|
||||
for _, hm := range []string{"02:00", "02:15", "02:30", "02:59", "03:00", "03:30", "04:15", "05:30", "06:00", "22:00"} {
|
||||
now, line := win.from, ""
|
||||
for now.Before(win.to) {
|
||||
next := nextDailyRunAt(hm, now)
|
||||
line += " " + next.In(loc).Format("01-02 15:04 MST") + "(" + next.UTC().Format("15:04Z") + ")"
|
||||
now = next
|
||||
}
|
||||
t.Logf("%s:%s", hm, line)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user