restic: judge the night by its health tool again beside an awake process, and keep each item's last good night as its own state good (issue 1955, ADR 0571)

This commit is contained in:
2026-10-29 23:46:57 +01:00
parent 9d0ebe556e
commit b1fa4855e6
5 changed files with 146 additions and 3 deletions
@@ -78,6 +78,14 @@ func TestEveryItemIsSaidWithItsReadingAndItsLastGoodBackup(t *testing.T) {
if dumps == nil || dumps.LastBackup != nil || dumps.SizeBytes != nil {
t.Fatalf("an item with no reading or no backup is said with one: %+v", dumps)
}
// The same last good night is kept on the bus beside good.json, one row per item a backup path covers.
b.Node = "ace"
rows, err := b.GoodRows()
must(t, err)
row, ok := rows[GoodKey("ace", "postgres", "store")]
if len(rows) != 1 || !ok || !row.LastGood.Equal(night) || row.CoveredBy != "/var/lib/mesh-store/dumps" || row.V != GoodVersion {
t.Fatalf("the good rows are %+v", rows)
}
}
// A retired item is deleted only after a last restore point of it, tagged as retired; a restore point