| new file mode 100644 |
| index 000000000..81887bf6c |
| --- /dev/null |
| +++ b/internal/provision/member_backups_2a_census_test.go |
| @@ -0,0 +1,46 @@ |
| +package provision |
| + |
| +// memberBackups2aWriteCensusInventory is the member backups slice 2a |
| +// (#898) review of the record-write census, layered on |
| +// linkedDeploymentsSlice1WriteCensusInventory. Slice 2a moves the restore |
| +// drill's record from the one shared control/restore-verify.json to one |
| +// record per box, control/verify/<ref>.json, written only by that box. |
| +// |
| +// Three units are re-digested; no record write is added and no class or |
| +// kind changes. None of them touches an instance record or a sidecar: |
| +// - dbverify.Publish: writes rec at dbverify.KeyFor(rec.Box), refusing a |
| +// ref boxself.ValidRef refuses (ErrInvalidRef, nothing written), instead |
| +// of the fixed control/restore-verify.json. The same Get-then-CAS Put, |
| +// three attempts. A control/ key, not a record path. nonrecord / |
| +// sel:Put, as before. |
| +// - dbverify.RemoveHost: takes the box ref and edits only that box's |
| +// record at KeyFor(ref), with the same refusal; other boxes' records |
| +// are never touched. The load, delete and CAS Put inside each attempt |
| +// are unchanged. nonrecord / sel:Put, as before. |
| +// - moves.OfflineManifest: the restore-verify row's description names |
| +// control/verify/<ref>.json instead of control/restore-verify.json. |
| +// Text in a table literal; no write. reference / lit:instances, as |
| +// before. |
| +func memberBackups2aWriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), linkedDeploymentsSlice1WriteCensusInventory()...) |
| + repins := []censusEntry{ |
| + {"internal/dbverify/dbverify.go", "Publish", "nonrecord", "sel:Put", "93f858f1d635ea8104777ca1700f7b643a98704a11291562f4c2e043bf027ddb"}, |
| + {"internal/dbverify/dbverify.go", "RemoveHost", "nonrecord", "sel:Put", "a1fff3088189aaa9df862da3f2bc2a41acedbc51a17fbcf62ae0fd2f675d8394"}, |
| + {"internal/moves/offline.go", "var OfflineManifest", "reference", "lit:instances", "523d76fbb204f07a151772117a7e5bb2c9b25a81ca7aaff417231e9b205abc43"}, |
| + } |
| + for _, r := range repins { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + if e.Class != r.Class || e.Kinds != r.Kinds { |
| + panic("member-backups-2a census: classification changed for " + r.File + ":" + r.Unit) |
| + } |
| + entries[i], found = r, true |
| + } |
| + } |
| + if !found { |
| + panic("member-backups-2a census: re-pin of an unlisted unit " + r.File + ":" + r.Unit) |
| + } |
| + } |
| + return entries |
| +} |