| new file mode 100644 |
| index 000000000..9907c2a62 |
| --- /dev/null |
| +++ b/internal/provision/sr_followups_census_test.go |
| @@ -0,0 +1,50 @@ |
| +package provision |
| + |
| +// srFollowupsWriteCensusInventory is the sr-followups branch's (#1061, |
| +// #966, #1060) review of the record-write census, layered on |
| +// flatPlansWriteCensusInventory (main's newest at the merge of 138f2e37). |
| +// Self-review only; the independent #280 verdict is the reviewer's. |
| +// |
| +// No record write is added and no class or kind changes. Three units are |
| +// re-digested and one config-ack writer is added: |
| +// - labelRefusal (instances_cli.go, #1060): a floor refusal whose build is |
| +// not a release version (release.NotReleaseBuild) prints the new |
| +// labelFloorNotRelease line instead of labelFloor. Message text only; |
| +// key-site, lit:sidecars, as before. |
| +// - WriteConfigAck (internal/appconfig/configack.go, #966): its |
| +// read-before-write takes the existing ack's ETag through configAckETag |
| +// (Open, close unread when the stream carries an ETag, else read at most |
| +// 64 KiB and discard) instead of s.Get. Same key (ConfigAckKey under |
| +// control/config-ack/, or the fleet corner through a prefix store), same |
| +// CAS Put; nonrecord, sel:Put, as before. |
| +// - sourceFinal.configAck (internal/host/movesfinal.go, #966): a comment |
| +// only, that the root ack key is read here because moves refuse fleet |
| +// routes. Code unchanged; nonrecord, sel:Put, as before. |
| +// - ReplaceConfigAckBlind (internal/appconfig/configack.go, #966), new: a |
| +// Delete then a create-only Put of the same config ack body at |
| +// ConfigAckKey, with no read of the key. Called only by |
| +// configAckRootFunc (internal/host/agent.go) for the root adopt pass on |
| +// a door box, through configAckStore's fleets/<fleet>/ prefix store. A |
| +// config ack is not a host record and names no record key: nonrecord, |
| +// sel:Put, as WriteConfigAck. |
| +func srFollowupsWriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), flatPlansWriteCensusInventory()...) |
| + for _, r := range []censusEntry{ |
| + {"instances_cli.go", "labelRefusal", "key-site", "lit:sidecars", "93375a0ff779cd42120ef29ecf389ba17dba8b12a8793ea907dd69b9d3113e28"}, |
| + {"internal/appconfig/configack.go", "WriteConfigAck", "nonrecord", "sel:Put", "8dba7cab65ff994109d3edc75058101c90c2998f52afdce4734d29bb8259913c"}, |
| + {"internal/host/movesfinal.go", "sourceFinal.configAck", "nonrecord", "sel:Put", "29eb4a6dd1944a8ba33b8cdb3b794d45336557b988976fbbcd6ff77dd1e054b3"}, |
| + {"internal/appconfig/configack.go", "ReplaceConfigAckBlind", "nonrecord", "sel:Put", "4abea553f02c2bd0a520e6d1d39ccb79f4563a36d5575a49c2d29513f701edea"}, |
| + } { |
| + replaced := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + entries[i], replaced = r, true |
| + break |
| + } |
| + } |
| + if !replaced { |
| + entries = append(entries, r) |
| + } |
| + } |
| + return entries |
| +} |