| new file mode 100644 |
| index 000000000..c2cf72f80 |
| --- /dev/null |
| +++ b/internal/provision/instance_restore_658_census_test.go |
| @@ -0,0 +1,41 @@ |
| +package provision |
| + |
| +// Record-write census entries for instance restore (#658), layered on |
| +// regionHAG2FixesWriteCensusInventory (the inventory TestPlan9B8RecordWriteCensus |
| +// used before this branch). Reviewed by the branch author and the |
| +// cross-model reviewer (Astra) with the branch. No record write is added and |
| +// no class or kind changes: |
| +// - Server.createRecordWithLifetimeLocked (Task 3): keeps the mark step's |
| +// observation (markForCreate now returns it) and sets the allocation's |
| +// restore_origin from it before BeginAllocation. A SQL column only; no |
| +// new bucket write. key-site / key:RecordKey, as before. |
| +// - Server.retireRecordWithLifetimeLocked (Task 4): passes the captured |
| +// body (obs.Raw at RecordETag; nil after a same-call migration) to |
| +// BeginRetirement as RecordBody. A SQL column only; the same record key. |
| +// key-site / key:RecordKey, as before. |
| +// - Server.retirementStepsLocked (Task 4): marks the row restorable |
| +// (MarkRetirementRestorable, SQL) when N1's write lands or a proven |
| +// tombstone is observed, before N2/N3, and is pending if that update |
| +// fails. Its one record write is the same N1 tombstone through |
| +// WriteRecord on the same captured ETag. record-writer / |
| +// key:RecordKey,key:WriteRecord, as before. |
| +func instanceRestore658WriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), regionHAG2FixesWriteCensusInventory()...) |
| + replacements := []censusEntry{ |
| + {"internal/console/lifetimes_create.go", "Server.createRecordWithLifetimeLocked", "key-site", "key:RecordKey", "e05edd5868ab2ba17f7c7bed2669c846facff70d17ae5aaf80a62017dc3abdf8"}, |
| + {"internal/console/lifetimes_retire.go", "Server.retireRecordWithLifetimeLocked", "key-site", "key:RecordKey", "e5b8fe974a0c6c21e08e059ec6baab1c569766d90c8a84aff405f02cdc51ba37"}, |
| + {"internal/console/lifetimes_retire.go", "Server.retirementStepsLocked", "record-writer", "key:RecordKey,key:WriteRecord", "e5bc1a1ef3ddba02c75217b18a71155f5fdbb82c67494cb60c57021ef05f2252"}, |
| + } |
| + for _, r := range replacements { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + entries[i], found = r, true |
| + } |
| + } |
| + if !found { |
| + panic("instance-restore-658 replacement of an unlisted unit " + r.File + ":" + r.Unit) |
| + } |
| + } |
| + return entries |
| +} |