console remote instances: round 4 review fixes (Astra, d8f11e4f)
1. P1: a remote row's readings are bounded on both sides: from the record's created_at up to when the box report it joined observed the host as this account's (the report's generation for a rollout entry, the console's read for an edges-file entry). A successor tenant's newer samples under the same hostname never join; the current reading is the newest sample inside the window. A report generated before the record existed joins nothing. Every console deletion invalidates the held box reports and reads that app's records from the bucket, not the record view's snapshot, for channelSettle. 2. P2: the retire guard refuses a record key the follower read did not see, and the retire door compares the app's record keys and modification times before its check and just before deleting the pointer (no lock covers record writes), refusing on any difference. 3. P2: tenant identity also comes from each box's edges file, which names the owner of every route kind (the rollout report skips statics, resident and unit-backed routes); read in the same cached load. Disagreeing sources give no identity; unidentified reports still contribute nothing. The test helper follows rollout.Managed and writes an edges file in the producer's shape. Tests fail first on d8f11e4f; 10 mutants, all killed. Census re-proposed (approval classes only); record-write: recordStamps added, pageRecords and retireUnsettled re-digested (key-site).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 files changed,
+663
−78
docs/superpowers/notes/census-proposal-console-remote-instances.md+6 −6docs/superpowers/notes/console-remote-instances.md+37 −1internal/console/apiinstances.go+10 −9internal/console/apiroutes.go+1 −1internal/console/metricsview.go+90 −3internal/console/remoteinstances.go+178 −22internal/console/remoteinstances_round1_test.go+1 −1internal/console/remoteinstances_round2_test.go+3 −1internal/console/remoteinstances_round4_test.go+233 −0internal/console/remoteinstances_test.go+43 −15internal/console/server.go+33 −4internal/console/view.go+7 −1internal/provision/console_remote_instances_census_test.go+9 −2internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv+11 −11
CI passed — run details
diff --git a/docs/superpowers/notes/census-proposal-console-remote-instances.md b/docs/superpowers/notes/census-proposal-console-remote-instances.md| index 6c62d04e2..67ff05ac6 100644 |
| --- a/docs/superpowers/notes/census-proposal-console-remote-instances.md |
| +++ b/docs/superpowers/notes/census-proposal-console-remote-instances.md |
| @@ -5,15 +5,15 @@ Ruling `census-ruling-console-remote-instances`. Every change below keeps the di |
| | unit | change | read sites | what changed | |
| |---|---|---|---| |
| | `internal/console/accountfleet.go` `Server.assembleAccountFleet` | body | unchanged (9) | Fleet tab: the shared-fleet app count also reads the account's own instance records (per app of the account, under its own prefix, region not a fleet placement); the registry read is unchanged. | |
| -| `internal/console/apiinstances.go` `Server.healthByHost` | body | unchanged (12) | Takes an awake set, a box pin per host and an ownership start per host from the caller (readings only from that box and only from samples at or after the start, via ownerAppMetricsFrom); registry reads unchanged. | |
| -| `internal/console/apiroutes.go` `Server.handleAPIRoutes` | body | unchanged (33) | Passes nil for healthByHost's new awake, box-pin and ownership-start arguments; nothing else. | |
| -| `internal/console/claim_retire.go` `Server.retireClaimHostRecord` | body | unchanged (1) | Notes the app in the console's in-memory deletion log (noteRecordDeletion) before retiring a record, for the canary-retire guard; the retire itself is unchanged. | |
| +| `internal/console/apiinstances.go` `Server.healthByHost` | body | unchanged (12) | Takes an awake set, a box pin per host and an ownership window per host (since, until) from the caller: readings only from that box and only from samples inside the window, via ownerAppMetricsFrom; registry reads unchanged. | |
| +| `internal/console/apiroutes.go` `Server.handleAPIRoutes` | body | unchanged (33) | Passes nil for healthByHost's new awake, box-pin and ownership-window arguments; nothing else. | |
| +| `internal/console/claim_retire.go` `Server.retireClaimHostRecord` | body | unchanged (1) | Notes the app in the console's in-memory deletion log (noteRecordDeletion, which also invalidates the pages' held box reports) before retiring a record, for the canary-retire guard; the retire itself is unchanged. | |
| | `internal/console/instancepage.go` `Server.handleAppInstance` | body | unchanged (6) | A remote row (no local registry row) takes its aliases from its box report; local rows read ListAliases as before. | |
| | `internal/console/metricsview.go` `buildUnitRows` | body | unchanged (2) | Each unit row also keeps its raw per-sample readings (float32 CPU, int64 memory) so an owner's graph can be redrawn from only their samples; reads nothing new. | |
| | `internal/console/metricsview.go` `type UnitRow` | body | unchanged (1) | Two unexported fields carrying those raw per-sample readings; schema only. | |
| -| `internal/console/server.go` `Server.channelHosts` | body | unchanged (4) | Canary-retire guard also counts the account's instance records (ListRecordsStrict) and sidecar records (listed, then each read with GetSidecarRecord; any read error refuses) naming the channel; with none, it refuses unless the app has settled (retireUnsettled: no record created, changed or deleted within channelSettle, every box report read, no box serving a host of the app that no record names). The registry read is as on main. Fails closed. | |
| +| `internal/console/server.go` `Server.channelHosts` | body | unchanged (4) | Canary-retire guard also counts the account's instance records (ListRecordsStrict) and sidecar records (listed, then each read with GetSidecarRecord; any read error refuses) naming the channel; with none, it refuses unless the app has settled (retireUnsettled). The registry read is as on main. Fails closed. | |
| | `internal/console/templates/app_overview.html` `external` | body | unchanged (1) | Running tile does not claim Served when a route's state is unknown and reads the existing 'no data right now' when every instance's state is unknown; Web addresses tile reads 'no data right now' instead of 'DNS & certs OK' for a domain with no reading; display only. | |
| -| `internal/console/apiinstances.go` `Server.instanceHealth` | sites | +whole:Route ×4 | Records with no local registry row get health only from a box report naming the record's own account and app (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by each record's created_at. Builds registry.Route literals from the record; reads no registry for them. | |
| +| `internal/console/apiinstances.go` `Server.instanceHealth` | sites | +whole:Route ×4 | Records with no local registry row get health only from a box report (rollout entry or edges-file owner) naming the record's own account and app and generated after the record existed (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by the record's created_at and the report's observation. Builds registry.Route literals from the record; reads no registry for them. | |
| | `internal/console/view.go` `Assemble` | sites | +registry:Host, +whole:Route | Collects the set of local registry hosts (rt.Host) so a record host the registry has gets no remote row (its record's created_at bounds the local row's metrics history); adds rows from the account's records and tenant-named box reports when given a remote source. | |
| Envelopes re-pinned: `internal/console`, `internal/console/templates`. |
| @@ -34,6 +34,6 @@ Recorded dispositions, which each change must still satisfy: |
| - `internal/console/apiinstances.go` `Server.instanceHealth`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route |
| - `internal/console/view.go` `Assemble`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route |
| -Seal: `0c4eabfe38e12b098285bdeb5ceb0b16e5333928f5b02e160a6b16b5fd9ce1e0` → `5114dd8af8a2c60628d0b161b210f4cff1eca7adb1a1e5f01408a6f4590c74fd`. |
| +Seal: `0c4eabfe38e12b098285bdeb5ceb0b16e5333928f5b02e160a6b16b5fd9ce1e0` → `b173449e9f3369a83c6475acbbae8afba61660b7f77ecf5535e8c8ce7031ca94`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/notes/console-remote-instances.md b/docs/superpowers/notes/console-remote-instances.md| index a37fa3e42..5cb3785b7 100644 |
| --- a/docs/superpowers/notes/console-remote-instances.md |
| +++ b/docs/superpowers/notes/console-remote-instances.md |
| @@ -138,7 +138,7 @@ is filed as an amadan discussion. |
| their record too, for the metrics bound), the read the Logs tab always |
| made. There is no cap: every record is read, so no instance is ever |
| dropped from the pages. |
| - - Box reports: 1 LIST plus 1 GET per box, held console-wide for 60 seconds |
| + - Box reports and edges files: 1 LIST plus 1 GET per box each, held console-wide for 60 seconds |
| (10 seconds after a failed or incomplete read), timed from when the load |
| finished. One load at a time; a view waiting behind a slow load stops |
| waiting when its own request ends. Boxes rewrite their reports every five |
| @@ -294,3 +294,39 @@ conservative rule. |
| minutes. A record deleted directly from the bucket, behind every |
| console door, is caught only while a box still reports its host. |
| +## Round 4 review (Astra, d8f11e4f) |
| + |
| +1. **Successor samples.** A remote row's readings are now bounded on both |
| + sides: from the record's `created_at` up to when the box report it joined |
| + observed the host as this account's. That is the report's generation for |
| + a rollout entry, or the console's read for an edges-file entry. A |
| + hostname can change hands on the same box while the console still holds |
| + the old ownership, and a newer sample may then be the successor's. The |
| + current reading is the newest sample inside the window, and nothing at |
| + all if that sample is older than the metrics fresh window (8 minutes). A |
| + remote row's reading therefore lags by up to one status snapshot period |
| + (5 minutes) for rollout-managed hosts, or one cache age (60 seconds) for |
| + edges-file identities. A report generated before the record existed |
| + joins nothing. Every console deletion also invalidates the held box |
| + reports and makes the pages read that app's records from the bucket, not |
| + the record view's snapshot, for `channelSettle`. |
| +2. **Records created between the retire listings.** The modification-time |
| + listing refuses any record key the follower read did not see. There is |
| + no lock that record writes take (the app-mutation runner is a claim-mode |
| + admission, not a lock), so the retire door takes the app's record keys |
| + and modification times before its check and again just before deleting |
| + the pointer, inside the app mutation, and refuses on any difference. |
| +3. **Identity for every route kind.** The rollout report covers only the |
| + routes the rollout manages (never statics, non-hibernating instances or |
| + unit-backed routes). Each box's edges file publishes the account and app |
| + that own every host it serves. It is read with the box reports, in the |
| + same cached load, and identifies the hosts the rollout does not cover. |
| + Where both sources speak and disagree, the host has no identity. |
| + Reports with no identity still contribute nothing. The test helper now |
| + writes rollout entries by production's `rollout.Managed` rule, and |
| + writes an edges file in the producer's shape. |
| + |
| +Request budget change: the cached load also lists and reads |
| +`control/edges/` (1 LIST plus 1 GET per box), at most once a minute |
| +console-wide. |
| + |
diff --git a/internal/console/apiinstances.go b/internal/console/apiinstances.go| index e7fc4e2cc..42218d7f2 100644 |
| --- a/internal/console/apiinstances.go |
| +++ b/internal/console/apiinstances.go |
| @@ -291,6 +291,7 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) ma |
| // report names no tenant, its state is unknown and says so. |
| var awake map[string]bool |
| boxByHost := map[string]string{} |
| + untilByHost := map[string]time.Time{} |
| if s.cfg.Releases != nil { |
| var reports fleetReports |
| loaded := false |
| @@ -299,10 +300,9 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) ma |
| continue |
| } |
| if !loaded { |
| - boxes, complete := s.pageBoxReports(ctx) |
| - reports, loaded = foldFleetReports(boxes, complete, time.Now()), true |
| + reports, loaded = foldFleet(s.pageFleet(ctx), time.Now()), true |
| } |
| - rep := reports.pick(rec.Host, rec.Account, rec.App) |
| + rep := reports.pick(rec.Host, rec.Account, rec.App, rec.CreatedAt) |
| if rep == nil { |
| if _, fleetPlaced := registry.FleetPlacement(rec.Region); reports.seen(rec.Host) || !reports.complete || fleetPlaced { |
| out[rec.Host] = healthUnknown |
| @@ -327,6 +327,7 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) ma |
| routeFor[rec.Host] = registry.Route{Host: rec.Host, Kind: kind, Status: status, |
| Hibernate: rec.HibernateOrDefault(), Provisioned: true} |
| boxByHost[rec.Host] = rep.box |
| + untilByHost[rec.Host] = rep.obsAt |
| if rep.awake { |
| if awake == nil { |
| awake = map[string]bool{} |
| @@ -343,7 +344,7 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) ma |
| sinceByHost[rec.Host] = rec.CreatedAt |
| } |
| } |
| - for h, word := range s.healthByHost(ctx, routeFor, awake, boxByHost, sinceByHost) { |
| + for h, word := range s.healthByHost(ctx, routeFor, awake, boxByHost, sinceByHost, untilByHost) { |
| out[h] = word |
| } |
| return out |
| @@ -366,10 +367,10 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) ma |
| // another box, joined from its box report by instanceHealth): those read as |
| // reporting even when the sweep has no sample yet, as the Running tab reads |
| // them. boxByHost pins such a host's readings to the box whose report was |
| -// accepted for it, and sinceByHost bounds a host's readings by when its |
| -// owner came to have it (ownerAppMetricsFrom). All nil for routes the |
| -// caller has no record for. |
| -func (s *Server) healthByHost(ctx context.Context, routeFor map[string]registry.Route, awake map[string]bool, boxByHost map[string]string, sinceByHost map[string]time.Time) map[string]string { |
| +// accepted for it, and sinceByHost and untilByHost bound a host's readings |
| +// by when its owner came to have it and when its box last vouched for that |
| +// (ownerAppMetricsFrom). All nil for routes the caller has no record for. |
| +func (s *Server) healthByHost(ctx context.Context, routeFor map[string]registry.Route, awake map[string]bool, boxByHost map[string]string, sinceByHost, untilByHost map[string]time.Time) map[string]string { |
| out := make(map[string]string, len(routeFor)) |
| hosts := make([]string, 0, len(routeFor)) |
| unitByHost := map[string]string{} |
| @@ -379,7 +380,7 @@ func (s *Server) healthByHost(ctx context.Context, routeFor map[string]registry. |
| unitByHost[h] = rt.Unit |
| } |
| } |
| - am, err := s.ownerAppMetricsFrom(ctx, hosts, unitByHost, boxByHost, sinceByHost) |
| + am, err := s.ownerAppMetricsFrom(ctx, hosts, unitByHost, boxByHost, sinceByHost, untilByHost) |
| if err != nil { |
| // An unreadable sweep is not knowledge that these instances are |
| // down: every host reads as not-reporting below, which healthWord |
diff --git a/internal/console/apiroutes.go b/internal/console/apiroutes.go| index 9c0a3079b..02886c5f9 100644 |
| --- a/internal/console/apiroutes.go |
| +++ b/internal/console/apiroutes.go |
| @@ -153,7 +153,7 @@ func (s *Server) handleAPIRoutes(w http.ResponseWriter, r *http.Request) { |
| } |
| ctx, cancel := context.WithTimeout(r.Context(), routeListTimeout) |
| defer cancel() |
| - health := s.healthByHost(ctx, routeFor, nil, nil, nil) |
| + health := s.healthByHost(ctx, routeFor, nil, nil, nil, nil) |
| join := loadBoxJoin(ctx, s.cfg.Releases, time.Now()) |
| rows := make([]apiRoute, 0, len(routeFor)) |
| for _, rt := range routeFor { |
diff --git a/internal/console/metricsview.go b/internal/console/metricsview.go| index 47156bf9d..0683a5274 100644 |
| --- a/internal/console/metricsview.go |
| +++ b/internal/console/metricsview.go |
| @@ -662,6 +662,72 @@ func unitRawMem(samples []metrics.Sample, unit string) []int64 { |
| return out |
| } |
| +// windowed is a unit's reading and graphs from the samples inside a window. |
| +type windowed struct { |
| + at time.Time |
| + cpu *float64 |
| + mem *int64 |
| + sparkCPU, sparkMem string |
| +} |
| + |
| +// windowReading is a unit's newest reading inside [since, until] and its |
| +// two graphs drawn from only those samples (memory scaled to the peak |
| +// within them). ok is false when the unit has no reading there. |
| +func windowReading(times []time.Time, u UnitRow, since, until time.Time) (windowed, bool) { |
| + if len(times) != len(u.cpu) || len(times) != len(u.mem) { |
| + return windowed{}, false |
| + } |
| + k1 := sort.Search(len(times), func(i int) bool { return !times[i].Before(since) }) |
| + k2 := sort.Search(len(times), func(i int) bool { return times[i].After(until) }) |
| + if k1 >= k2 { |
| + return windowed{}, false |
| + } |
| + var w windowed |
| + for i := k2 - 1; i >= k1; i-- { |
| + hasCPU, hasMem := !math.IsNaN(float64(u.cpu[i])), u.mem[i] >= 0 |
| + if !hasCPU && !hasMem { |
| + continue |
| + } |
| + w.at = times[i] |
| + if hasCPU { |
| + c := float64(u.cpu[i]) |
| + w.cpu = &c |
| + } |
| + if hasMem { |
| + m := u.mem[i] |
| + w.mem = &m |
| + } |
| + break |
| + } |
| + if w.at.IsZero() { |
| + return windowed{}, false |
| + } |
| + n := k2 - k1 |
| + cs := make([]*float64, n) |
| + var peak int64 |
| + for i := k1; i < k2; i++ { |
| + if c := u.cpu[i]; !math.IsNaN(float64(c)) { |
| + f := float64(c) |
| + cs[i-k1] = &f |
| + } |
| + if u.mem[i] > peak { |
| + peak = u.mem[i] |
| + } |
| + } |
| + var ms []*float64 |
| + if peak > 0 { |
| + ms = make([]*float64, n) |
| + for i := k1; i < k2; i++ { |
| + if u.mem[i] >= 0 { |
| + f := float64(u.mem[i]) / float64(peak) |
| + ms[i-k1] = &f |
| + } |
| + } |
| + } |
| + w.sparkCPU, w.sparkMem = sparkPoints(cs, 240, 40), sparkPoints(ms, 240, 40) |
| + return w, true |
| +} |
| + |
| // sparksSince redraws a unit's two graphs from only the samples at or after |
| // since, the memory one scaled to the peak within them. ok is false when |
| // the unit has no sample there at all. |
| @@ -791,7 +857,7 @@ func (m InstanceMetrics) Reporting() bool { return m.Box != "" } |
| // readings, Reporting false), never zeros and never silently dropped — an |
| // owner whose instance is asleep must still see it listed. |
| func (s *Server) OwnerAppMetrics(ctx context.Context, hosts []string, unitByHost map[string]string) ([]InstanceMetrics, error) { |
| - return s.ownerAppMetricsFrom(ctx, hosts, unitByHost, nil, nil) |
| + return s.ownerAppMetricsFrom(ctx, hosts, unitByHost, nil, nil, nil) |
| } |
| // ownerAppMetricsFrom is OwnerAppMetrics where sinceByHost bounds a host's |
| @@ -804,7 +870,7 @@ func (s *Server) OwnerAppMetrics(ctx context.Context, hosts []string, unitByHost |
| // account (remoteinstances.go), so a box serving the same host name for |
| // another tenant cannot put its readings on this page. A host not named |
| // there reads as before: the freshest box's sample. |
| -func (s *Server) ownerAppMetricsFrom(ctx context.Context, hosts []string, unitByHost, boxByHost map[string]string, sinceByHost map[string]time.Time) ([]InstanceMetrics, error) { |
| +func (s *Server) ownerAppMetricsFrom(ctx context.Context, hosts []string, unitByHost, boxByHost map[string]string, sinceByHost, untilByHost map[string]time.Time) ([]InstanceMetrics, error) { |
| // The allowlist, keyed by the unit names each host can legally match. |
| // Matching is exact-string on this map: a unit the caller did not ask |
| // for cannot be reached by any path below. |
| @@ -866,6 +932,14 @@ func (s *Server) ownerAppMetricsFrom(ctx context.Context, hosts []string, unitBy |
| if bounded && (since.IsZero() || box.At.Before(since)) { |
| continue |
| } |
| + // The upper bound: an instance on another box is proven this |
| + // owner's only up to when its box's report was observed naming |
| + // them. A later sample may be a successor tenant's under the |
| + // same hostname, so it does not join. No bound known: nothing. |
| + until, capped := untilByHost[host] |
| + if capped && until.IsZero() { |
| + continue |
| + } |
| // A host that reports on two boxes at once (a move in flight) |
| // shows the freshest box's reading, not whichever sorted first. |
| if prev, taken := at[host]; taken && !box.At.After(prev) { |
| @@ -881,7 +955,20 @@ func (s *Server) ownerAppMetricsFrom(ctx context.Context, hosts []string, unitBy |
| SparkCPU: u.SparkCPU, |
| SparkMem: u.SparkMem, |
| } |
| - if bounded && (len(box.times) == 0 || box.times[0].Before(since)) { |
| + if capped && box.At.After(until) { |
| + // The newest samples are past the bound: the reading and |
| + // both graphs come from the samples inside it, and a reading |
| + // that old is no current reading at all. |
| + if !bounded { |
| + since = time.Time{} |
| + } |
| + w, ok := windowReading(box.times, u, since, until) |
| + if !ok || now.Sub(w.at) > metricsFreshWindow { |
| + delete(at, host) |
| + continue |
| + } |
| + row.ObservedAt, row.CPUFrac, row.MemBytes, row.SparkCPU, row.SparkMem = w.at, w.cpu, w.mem, w.sparkCPU, w.sparkMem |
| + } else if bounded && (len(box.times) == 0 || box.times[0].Before(since)) { |
| // Part of the window predates the owner: redraw from only |
| // their samples, or draw nothing when that cannot be done. |
| row.SparkCPU, row.SparkMem, _ = sparksSince(box.times, u, since) |
diff --git a/internal/console/remoteinstances.go b/internal/console/remoteinstances.go| index 898803a8c..1041c311f 100644 |
| --- a/internal/console/remoteinstances.go |
| +++ b/internal/console/remoteinstances.go |
| @@ -26,6 +26,7 @@ package console |
| import ( |
| "context" |
| + "encoding/json" |
| "errors" |
| "fmt" |
| "log" |
| @@ -61,7 +62,10 @@ type boxReportCache struct { |
| failed bool // the held read failed or was incomplete: boxReportFailTTL |
| boxes []status.Box |
| complete bool |
| - loading chan struct{} |
| + // owners is every box's edges file's word on who owns each host it |
| + // serves: box label -> host -> {account, app}, read with the reports. |
| + owners map[string]map[string][2]string |
| + loading chan struct{} |
| // now is the cache's clock; nil is time.Now. Tests set it. |
| now func() time.Time |
| } |
| @@ -86,8 +90,34 @@ func (c *boxReportCache) clock() time.Time { |
| // then gets whatever the cache held before, reported incomplete. The |
| // snapshots are shared and must not be changed. |
| func (s *Server) pageBoxReports(ctx context.Context) ([]status.Box, bool) { |
| + r := s.pageFleet(ctx) |
| + return r.boxes, r.complete |
| +} |
| + |
| +// fleetRead is one console-wide read: every box's status report, whether |
| +// all were read, every box's edges-file owners, and when the read finished |
| +// (the console's observation time for the owners). |
| +type fleetRead struct { |
| + boxes []status.Box |
| + complete bool |
| + owners map[string]map[string][2]string |
| + at time.Time |
| +} |
| + |
| +// invalidate drops the held read, so the next page view reads afresh. Every |
| +// console path that deletes a record calls it (noteRecordDeletion): a held |
| +// read may still name the deleted record's tenant for its host. |
| +func (c *boxReportCache) invalidate() { |
| + c.mu.Lock() |
| + defer c.mu.Unlock() |
| + c.valid = false |
| +} |
| + |
| +// pageFleet is pageBoxReports with the edges-file owners and the read's |
| +// time. |
| +func (s *Server) pageFleet(ctx context.Context) fleetRead { |
| if s.cfg.Releases == nil { |
| - return nil, false |
| + return fleetRead{} |
| } |
| c := &s.boxReports |
| for { |
| @@ -97,18 +127,18 @@ func (s *Server) pageBoxReports(ctx context.Context) ([]status.Box, bool) { |
| ttl = boxReportFailTTL |
| } |
| if c.valid && c.clock().Sub(c.at) < ttl { |
| - boxes, complete := c.boxes, c.complete |
| + r := fleetRead{boxes: c.boxes, complete: c.complete, owners: c.owners, at: c.at} |
| c.mu.Unlock() |
| - return boxes, complete |
| + return r |
| } |
| if wait := c.loading; wait != nil { |
| - held := c.boxes |
| + held := fleetRead{boxes: c.boxes, owners: c.owners, at: c.at} |
| c.mu.Unlock() |
| select { |
| case <-wait: |
| continue |
| case <-ctx.Done(): |
| - return held, false |
| + return held |
| } |
| } |
| done := make(chan struct{}) |
| @@ -117,20 +147,55 @@ func (s *Server) pageBoxReports(ctx context.Context) ([]status.Box, bool) { |
| loadCtx, cancel := context.WithTimeout(context.WithoutCancel(ctx), instanceStoreTimeout) |
| boxes, complete, err := status.LoadBoxesComplete(loadCtx, s.cfg.Releases) |
| - cancel() |
| if err != nil { |
| log.Printf("console: box reports for the app pages: %v", err) |
| boxes, complete = nil, false |
| } |
| + owners := edgesOwners(loadCtx, s.cfg.Releases) |
| + cancel() |
| c.mu.Lock() |
| - c.at, c.valid, c.failed, c.boxes, c.complete = c.clock(), true, err != nil || !complete, boxes, complete |
| + c.at, c.valid, c.failed, c.boxes, c.complete, c.owners = c.clock(), true, err != nil || !complete, boxes, complete, owners |
| + r := fleetRead{boxes: boxes, complete: complete, owners: owners, at: c.at} |
| c.loading = nil |
| close(done) |
| c.mu.Unlock() |
| - return boxes, complete |
| + return r |
| } |
| } |
| +// edgesOwners reads every box's edges file (control/edges/<box>.json) and |
| +// returns, per box label, the account and app it publishes for each host it |
| +// serves. A box publishes them only when every route behind the hostname |
| +// agrees (internal/host's servedOwners), so a host split between apps, or |
| +// one in a file the console cannot read, has no owner here. Unlike the |
| +// rollout report, the edges file covers every route kind: static sites and |
| +// instances that never sleep included. Best effort: a failed read is no |
| +// owners, and the hosts it would have named stay unidentified. |
| +func edgesOwners(ctx context.Context, store release.Store) map[string]map[string][2]string { |
| + snap, err := readEdgesSnapshot(ctx, store) |
| + if err != nil { |
| + log.Printf("console: edges files for the app pages: %v", err) |
| + return nil |
| + } |
| + out := map[string]map[string][2]string{} |
| + for _, f := range snap.Files { |
| + for host, raw := range f.Hosts { |
| + var h struct { |
| + Account string `json:"account"` |
| + App string `json:"app"` |
| + } |
| + if json.Unmarshal(raw, &h) != nil || h.Account == "" || h.App == "" { |
| + continue |
| + } |
| + if out[f.Box] == nil { |
| + out[f.Box] = map[string][2]string{} |
| + } |
| + out[f.Box][host] = [2]string{h.Account, h.App} |
| + } |
| + } |
| + return out |
| +} |
| + |
| // hostReport is one fresh box's word about one host it serves. |
| type hostReport struct { |
| box string |
| @@ -144,10 +209,16 @@ type hostReport struct { |
| reading *status.AliasReading |
| // aliases are the custom domains this box routes to the host. |
| aliases []string |
| - // tenantKnown is whether the box's rollout report names the host's |
| - // account and app; awake is only meaningful when it does. |
| + // tenantKnown is whether the box names the host's account and app: its |
| + // rollout report does for the hosts the rollout manages, its edges file |
| + // for every route kind. obsAt is when that identity was observed: the |
| + // report's generation for a rollout entry, the console's read for an |
| + // edges-file entry (rewritten by the box on every change). awake is only |
| + // meaningful from a rollout entry. Two sources naming different tenants |
| + // give no identity at all. |
| tenantKnown bool |
| account, app string |
| + obsAt time.Time |
| awake bool |
| // down is a failed hold-mode build that left the host with nothing |
| // serving it (status.AttemptDown): its wakes are refused. transient is |
| @@ -168,7 +239,14 @@ type fleetReports struct { |
| // Stale boxes are left out under the fleet's one staleness rule |
| // (status.BoxStale), as every other box join does. |
| func foldFleetReports(boxes []status.Box, complete bool, now time.Time) fleetReports { |
| - f := fleetReports{byHost: map[string][]hostReport{}, complete: complete} |
| + return foldFleet(fleetRead{boxes: boxes, complete: complete, at: now}, now) |
| +} |
| + |
| +// foldFleet is foldFleetReports over a whole read, edges-file owners |
| +// included. |
| +func foldFleet(read fleetRead, now time.Time) fleetReports { |
| + boxes := read.boxes |
| + f := fleetReports{byHost: map[string][]hostReport{}, complete: read.complete} |
| for _, b := range boxes { |
| m := b.Metrics |
| if m == nil || status.BoxStale(b, now, status.SnapshotPeriod) { |
| @@ -195,7 +273,7 @@ func foldFleetReports(boxes []status.Box, complete bool, now time.Time) fleetRep |
| if m.Rollout != nil { |
| for host, hr := range m.Rollout.Hosts { |
| r := get(host) |
| - r.tenantKnown, r.account, r.app = true, hr.Account, hr.App |
| + r.tenantKnown, r.account, r.app, r.obsAt = hr.Account != "" && hr.App != "", hr.Account, hr.App, b.GeneratedAt |
| r.awake = hr.Awake && !hr.Transient |
| r.down = hr.Attempt == status.AttemptDown |
| r.transient = hr.Transient |
| @@ -212,6 +290,20 @@ func foldFleetReports(boxes []status.Box, complete bool, now time.Time) fleetRep |
| r.aliases = append(r.aliases, name) |
| } |
| } |
| + // The edges file names owners for every route kind. It identifies a |
| + // host the rollout does not manage; where both speak, they must |
| + // agree, or the host has no identity. |
| + for host, r := range reps { |
| + o, ok := read.owners[b.Label][host] |
| + switch { |
| + case !ok: |
| + case !r.tenantKnown && r.account == "" && r.app == "": |
| + r.tenantKnown, r.account, r.app, r.obsAt = true, o[0], o[1], read.at |
| + case r.account != o[0] || r.app != o[1]: |
| + r.tenantKnown = false |
| + r.account, r.app = "conflict", "conflict" |
| + } |
| + } |
| for host, r := range reps { |
| sort.Strings(r.aliases) |
| f.byHost[host] = append(f.byHost[host], *r) |
| @@ -228,11 +320,15 @@ func foldFleetReports(boxes []status.Box, complete bool, now time.Time) fleetRep |
| // reading. Among the rest the freshest wins, then the lower box label, so |
| // the choice is stable. Two boxes reporting one host is a move in flight; |
| // the page shows one row. |
| -func (f fleetReports) pick(host, acct, app string) *hostReport { |
| +// |
| +// since is the record's created_at: a report the box generated before the |
| +// record existed is about some earlier owner of the hostname, never this |
| +// one. Zero accepts any time (callers with no record). |
| +func (f fleetReports) pick(host, acct, app string, since time.Time) *hostReport { |
| var best *hostReport |
| for i := range f.byHost[host] { |
| r := &f.byHost[host][i] |
| - if !r.tenantKnown || r.account != acct || r.app != app { |
| + if !r.tenantKnown || r.account != acct || r.app != app || r.at.Before(since) { |
| continue |
| } |
| if best == nil || betterReport(r, best) { |
| @@ -334,6 +430,7 @@ func remoteRoute(rec provision.Record, rep *hostReport, f fleetReports, acct str |
| switch { |
| case rep != nil: |
| rv.Status = "ready" |
| + rv.until = rep.obsAt |
| rv.Version = rep.version |
| rv.box = rep.box |
| rv.dbBytes = rep.dbBytes |
| @@ -386,7 +483,7 @@ func (s *Server) pageRecords(ctx context.Context, acct, app string, skip map[str |
| return nil, nil |
| } |
| store := s.cfg.Releases |
| - if v := s.recordView; v != nil { |
| + if v := s.recordView; v != nil && !s.recentlyDeleted(acct, app, time.Now()) { |
| if sn := v.Snapshot(); sn != nil && sn.Complete { |
| store = sn.Store(s.cfg.Releases) |
| } |
| @@ -429,14 +526,14 @@ func (s *Server) remoteSource(ctx context.Context, acct string) *remoteRows { |
| if s.cfg.Releases == nil { |
| return nil |
| } |
| - boxes, complete := s.pageBoxReports(ctx) |
| + read := s.pageFleet(ctx) |
| return &remoteRows{ |
| records: func(app string, skip map[string]bool) ([]provision.Record, error) { |
| rctx, cancel := context.WithTimeout(ctx, instanceStoreTimeout) |
| defer cancel() |
| return s.pageRecords(rctx, acct, app, skip) |
| }, |
| - reports: foldFleetReports(boxes, complete, time.Now()), |
| + reports: foldFleet(read, time.Now()), |
| } |
| } |
| @@ -491,6 +588,10 @@ func (s *Server) retireUnsettled(ctx context.Context, acct, app string, keys, ho |
| } |
| for _, o := range objs { |
| if !keys[o.Key] { |
| + if recordKeyUnder(o.Key, prefix) { |
| + // Created after the follower read: it was not checked. |
| + return unsettled("%s appeared during the check", o.Key) |
| + } |
| continue |
| } |
| listed[o.Key] = true |
| @@ -510,11 +611,11 @@ func (s *Server) retireUnsettled(ctx context.Context, acct, app string, keys, ho |
| if err := s.recentRecordDeletion(acct, app, now); err != nil { |
| return err |
| } |
| - boxes, complete := s.pageBoxReports(ctx) |
| - if !complete { |
| + read := s.pageFleet(ctx) |
| + if !read.complete { |
| return unsettled("not every box report could be read") |
| } |
| - f := foldFleetReports(boxes, complete, now) |
| + f := foldFleet(read, now) |
| for host, reps := range f.byHost { |
| if hosts[host] { |
| continue |
| @@ -528,6 +629,45 @@ func (s *Server) retireUnsettled(ctx context.Context, acct, app string, keys, ho |
| return nil |
| } |
| +// recordKeyUnder reports whether key is a record key directly under |
| +// prefix: <prefix><name>.json, the shape the record listings read. |
| +func recordKeyUnder(key, prefix string) bool { |
| + rest, ok := strings.CutPrefix(key, prefix) |
| + if !ok || rest == "" || strings.Contains(rest, "/") { |
| + return false |
| + } |
| + name, ok := strings.CutSuffix(rest, ".json") |
| + return ok && name != "" |
| +} |
| + |
| +// recordStamps is every instance and sidecar record key of acct/app with |
| +// its modification time. The canary retire takes it before its check and |
| +// again just before deleting the pointer, and refuses on any difference: |
| +// no lock covers record writes, so this is what notices a follower |
| +// created, moved or deleted in between. |
| +func (s *Server) recordStamps(ctx context.Context, acct, app string) (map[string]time.Time, error) { |
| + out := map[string]time.Time{} |
| + if s.cfg.Releases == nil { |
| + return out, nil |
| + } |
| + ml, ok := s.cfg.Releases.(release.ModLister) |
| + if !ok { |
| + return nil, errors.New("the deployment store cannot list modification times, so a concurrent change cannot be ruled out") |
| + } |
| + for _, prefix := range []string{provision.RecordsPrefix(acct, app), provision.SidecarsPrefix(acct, app)} { |
| + objs, err := ml.ListMod(ctx, prefix) |
| + if err != nil { |
| + return nil, fmt.Errorf("record modification times of %s/%s: %w", acct, app, err) |
| + } |
| + for _, o := range objs { |
| + if recordKeyUnder(o.Key, prefix) { |
| + out[o.Key] = o.Mod |
| + } |
| + } |
| + } |
| + return out, nil |
| +} |
| + |
| // retireAuditWindow is how many of an app's most recent audit rows the |
| // deletion check reads; if all of them are inside channelSettle it cannot |
| // see past them, and says the app has not settled. |
| @@ -538,13 +678,29 @@ var processStart = time.Now() |
| // noteRecordDeletion records that an instance or sidecar record of |
| // acct/app is being deleted now (retireHostRecord calls it first). |
| +// |
| +// It also drops what the pages hold about ownership: the shared box-report |
| +// read is invalidated, and pageRecords reads this app's records from the |
| +// bucket rather than the record view's snapshot until channelSettle has |
| +// passed, so a deleted record cannot keep vouching for its tenant while |
| +// the hostname passes to someone else. |
| func (s *Server) noteRecordDeletion(acct, app string, at time.Time) { |
| s.deletionsMu.Lock() |
| - defer s.deletionsMu.Unlock() |
| if s.deletions == nil { |
| s.deletions = map[string]time.Time{} |
| } |
| s.deletions[acct+"/"+app] = at |
| + s.deletionsMu.Unlock() |
| + s.boxReports.invalidate() |
| +} |
| + |
| +// recentlyDeleted reports whether the console began deleting a record of |
| +// acct/app within channelSettle. |
| +func (s *Server) recentlyDeleted(acct, app string, now time.Time) bool { |
| + s.deletionsMu.Lock() |
| + defer s.deletionsMu.Unlock() |
| + at, ok := s.deletions[acct+"/"+app] |
| + return ok && now.Sub(at) < channelSettle |
| } |
| // recentRecordDeletion is errRetireUnsettled when an instance or sidecar of |
diff --git a/internal/console/remoteinstances_round1_test.go b/internal/console/remoteinstances_round1_test.go| index c1092aa57..f39f92b39 100644 |
| --- a/internal/console/remoteinstances_round1_test.go |
| +++ b/internal/console/remoteinstances_round1_test.go |
| @@ -122,7 +122,7 @@ func TestRemoteUnknownTenantReportHealth(t *testing.T) { |
| {Host: "r.example.com", App: "shop", Account: "a", Hibernate: &no, Addr: "127.0.0.1:1"}, |
| {Host: "s.example.com", App: "shop", Account: "a", Kind: "static"}, |
| } { |
| - rv, dv := remoteRoute(rec, f.pick(rec.Host, "a", "shop"), f, "a", DNSTargets{}) |
| + rv, dv := remoteRoute(rec, f.pick(rec.Host, "a", "shop", time.Time{}), f, "a", DNSTargets{}) |
| routes, domains = append(routes, rv), append(domains, dv) |
| } |
| view := &AppView{Routes: routes, Domains: domains} |
diff --git a/internal/console/remoteinstances_round2_test.go b/internal/console/remoteinstances_round2_test.go| index 7245c6812..860ca3cae 100644 |
| --- a/internal/console/remoteinstances_round2_test.go |
| +++ b/internal/console/remoteinstances_round2_test.go |
| @@ -50,6 +50,8 @@ func TestRemoteMetricsHistoryBoundedByRecord(t *testing.T) { |
| tb.setUp(t, false) |
| label := status.Label("box-b") |
| twoSamples(t, tb.fx.rel, label, "carlos-exec@"+remoteHost, time.Now().Add(-3*time.Hour), time.Now()) |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) // vouches for the owner after the sample |
| + tb.fx.srv.boxReports.expire() |
| views, err := tb.fx.srv.assembleApps(context.Background(), tb.sqid, []string{"shop"}) |
| if err != nil { |
| t.Fatal(err) |
| @@ -99,7 +101,7 @@ func TestOwnerMetricsSinceRules(t *testing.T) { |
| twoSamples(t, fx.rel, "box-x", "carlos-exec@"+host, time.Now().Add(-3*time.Hour), time.Now().Add(-90*time.Second)) |
| for name, since := range map[string]time.Time{"unknown start": {}, "start after the newest sample": time.Now().Add(-time.Minute)} { |
| fx.srv.metricsCache = metricsCache{} |
| - am, err := fx.srv.ownerAppMetricsFrom(context.Background(), []string{host}, nil, nil, map[string]time.Time{host: since}) |
| + am, err := fx.srv.ownerAppMetricsFrom(context.Background(), []string{host}, nil, nil, map[string]time.Time{host: since}, nil) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/console/remoteinstances_round4_test.go b/internal/console/remoteinstances_round4_test.go| new file mode 100644 |
| index 000000000..05f43ef6b |
| --- /dev/null |
| +++ b/internal/console/remoteinstances_round4_test.go |
| @@ -0,0 +1,233 @@ |
| +package console |
| + |
| +// Round 4 review fixes (Astra, d8f11e4f). |
| + |
| +import ( |
| + "context" |
| + "net/http" |
| + "strings" |
| + "sync" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/metrics" |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/release" |
| + "github.com/carlosframework/platform/internal/rollout" |
| + "github.com/carlosframework/platform/internal/status" |
| +) |
| + |
| +const residentHost = "always.shop.example.com" |
| + |
| +// P2 #3: a remote instance that never sleeps is outside the rollout report |
| +// (rollout.Managed), so its identity comes from its box's edges file. Its |
| +// row shows the box's version, readings and health, not "Can't tell". |
| +func TestRemoteResidentInstanceIdentifiedByEdgesFile(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + no := false |
| + if err := provision.CreateRecord(context.Background(), tb.fx.rel, provision.Record{Schema: 1, Host: residentHost, Slug: "always", |
| + App: "shop", Account: tb.sqid, Pool: "shop", Region: "uk", Channel: "stable", Hibernate: &no, CreatedAt: time.Now()}); err != nil { |
| + t.Fatal(err) |
| + } |
| + tb.reconcile(t, "v3") |
| + rt, err := tb.regB.Get(residentHost) |
| + if err != nil || rt == nil { |
| + t.Fatalf("fixture: B did not mint the resident instance: %v", err) |
| + } |
| + if rollout.Managed(*rt) { |
| + t.Fatalf("fixture: the resident route is rollout-managed: %+v", rt) |
| + } |
| + sweep(t, tb.fx.rel, status.Label("box-b"), map[string]metrics.UnitSample{ |
| + "carlos-exec@" + residentHost: {CPUFrac: p(0.27), MemBytes: pi64(3 << 20)}, |
| + }) |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) |
| + row := instanceRow(t, tb.page(t, "/apps/shop/instances"), residentHost) |
| + if strings.Contains(row, "Can't tell") || !strings.Contains(row, "v3") || !strings.Contains(row, "Running") { |
| + t.Fatalf("Running row for a resident remote instance = %s", row) |
| + } |
| + if ov := tb.page(t, "/apps/shop"); !strings.Contains(ov, "27%") { |
| + t.Fatalf("overview has no readings for the resident remote instance:\n%s", ov) |
| + } |
| +} |
| + |
| +// The edges file and the rollout report naming different tenants for one |
| +// host give it no identity at all. |
| +func TestEdgesAndRolloutDisagreeingIsNoIdentity(t *testing.T) { |
| + now := time.Now() |
| + boxes := []status.Box{{GeneratedAt: now, Label: "b", Metrics: &status.BoxMetrics{ |
| + RouteVersions: map[string]string{"h.example.com": "v2", "s.example.com": "v2"}, |
| + Rollout: &status.RolloutReport{Hosts: map[string]status.HostRollout{ |
| + "h.example.com": {Account: "a", App: "shop"}, |
| + }}, |
| + }}} |
| + owners := map[string]map[string][2]string{"b": {"h.example.com": {"z", "shop"}, "s.example.com": {"a", "shop"}}} |
| + f := foldFleet(fleetRead{boxes: boxes, complete: true, owners: owners, at: now}, now) |
| + if rep := f.pick("h.example.com", "a", "shop", time.Time{}); rep != nil { |
| + t.Fatalf("joined a host whose two sources disagree: %+v", rep) |
| + } |
| + if rep := f.pick("s.example.com", "a", "shop", time.Time{}); rep == nil || rep.version != "v2" || !rep.obsAt.Equal(now) { |
| + t.Fatalf("the edges-file identity of a host the rollout does not manage = %+v", rep) |
| + } |
| +} |
| + |
| +// P1 #1: the hostname passes to a successor tenant on the same box while |
| +// this account's ownership is still what the console holds (a stale record |
| +// snapshot, a cached report naming this account). The successor's samples, |
| +// newer than the report that vouched for this account, never join. |
| +func TestRemoteSuccessorSamplesNeverJoin(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + tb.create(t, tb.token, tb.sqid, "shop", remoteHost, "uk", "") |
| + tb.reconcile(t, "v3") |
| + time.Sleep(2100 * time.Millisecond) // created_at is whole seconds |
| + mine := time.Now().Add(-time.Second) |
| + unit := "carlos-exec@" + remoteHost |
| + chunk := func(samples ...metrics.Sample) { |
| + t.Helper() |
| + if err := metrics.WriteRaw(context.Background(), tb.fx.rel, metrics.RawChunk{V: 1, Box: status.Label("box-b"), |
| + Hour: metrics.HourOf(samples[0].At.UTC()), Samples: samples}); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + ownSample := metrics.Sample{At: mine.UTC(), Units: map[string]metrics.UnitSample{unit: {CPUFrac: p(0.27), MemBytes: pi64(3 << 20)}}} |
| + chunk(ownSample) |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) // vouches for this account now |
| + time.Sleep(1100 * time.Millisecond) |
| + // The successor's process, after the report: same unit name, same box. |
| + successor := metrics.Sample{At: time.Now().UTC(), Units: map[string]metrics.UnitSample{unit: {CPUFrac: p(0.66), MemBytes: pi64(7 << 20)}}} |
| + if metrics.HourOf(successor.At) != metrics.HourOf(ownSample.At) { |
| + t.Skip("the two samples straddle an hour boundary") |
| + } |
| + chunk(ownSample, successor) |
| + for _, path := range []string{"/apps/shop", "/apps/shop/instances", "/apps/shop/instances/" + remoteHost} { |
| + body := tb.page(t, path) |
| + if strings.Contains(body, "66%") || strings.Contains(body, "7.0 MB") { |
| + t.Fatalf("%s shows a sample newer than the report vouching for this account:\n%s", path, body) |
| + } |
| + } |
| + if ov := tb.page(t, "/apps/shop"); !strings.Contains(ov, "27%") { |
| + t.Fatalf("overview lost the sample the report does vouch for:\n%s", ov) |
| + } |
| +} |
| + |
| +// P1 #1: a console deletion invalidates the ownership the pages hold. With |
| +// the record view armed and its snapshot still holding the record, the |
| +// deleted instance's row is gone from the next page view. |
| +func TestRemoteDeletionInvalidatesHeldOwnership(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + tb.setUp(t, false) |
| + v := provision.NewRecordView(tb.fx.rel, release.NewChangeWatch(tb.fx.rel)) |
| + if err := v.Rebuild(context.Background()); err != nil { |
| + t.Fatal(err) |
| + } |
| + tb.fx.srv.SetRecordView(v) |
| + if run := tb.page(t, "/apps/shop/instances"); !strings.Contains(run, remoteHost) { |
| + t.Fatalf("fixture: the remote row is missing:\n%s", run) |
| + } |
| + if status, _, out := rawReq(t, http.MethodDelete, instancesURL(tb.fx, tb.sqid, "shop")+"/"+remoteHost, tb.token, ""); status != http.StatusOK { |
| + t.Fatalf("delete = %d %s", status, out) |
| + } |
| + // The snapshot is not refreshed: it still holds the record. |
| + if run := tb.page(t, "/apps/shop/instances"); strings.Contains(run, remoteHost) { |
| + t.Fatalf("a deleted record still vouches for its host through the held snapshot:\n%s", run) |
| + } |
| +} |
| + |
| +// createOnListMod creates a follower record the first time ListMod runs: |
| +// a record that appears between the follower read and the modification-time |
| +// listing. |
| +type createOnListMod struct { |
| + *deletableStore |
| + once *sync.Once |
| + create func() |
| +} |
| + |
| +func (s createOnListMod) ListMod(ctx context.Context, prefix string) ([]release.KeyMod, error) { |
| + s.once.Do(s.create) |
| + return s.deletableStore.ListMod(ctx, prefix) |
| +} |
| + |
| +func followerRecord(t *testing.T, tb *twoBoxes, host string) func() { |
| + return func() { |
| + if err := provision.CreateRecord(context.Background(), tb.fx.rel, provision.Record{Schema: 1, Host: host, |
| + Slug: strings.SplitN(host, ".", 2)[0], App: "shop", Account: tb.sqid, Pool: "shop", Region: "uk", |
| + Channel: "canary/rc", CreatedAt: time.Now()}); err != nil { |
| + t.Error(err) |
| + } |
| + } |
| +} |
| + |
| +// P2 #2: a follower created between the record read and the |
| +// modification-time listing is seen by the second listing, and refuses. |
| +func TestRetireRefusesRecordCreatedBetweenListings(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + shipAndPromote(t, tb.fx, tb.sqid, "shop", "v4", "canary/rc") |
| + tb.create(t, tb.token, tb.sqid, "shop", remoteHost, "uk", "stable") |
| + tb.reconcile(t, "v3") |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) |
| + ageRecords(t, tb) |
| + tb.fx.srv.boxReports.expire() |
| + ds := tb.fx.rel.(*deletableStore) |
| + tb.fx.srv.cfg.Releases = createOnListMod{ds, &sync.Once{}, followerRecord(t, tb, "late.shop.example.com")} |
| + if _, err := tb.fx.srv.channelHosts(context.Background(), tb.sqid, "shop", "canary/rc"); !errorsIsUnsettled(err) { |
| + t.Fatalf("a follower created between the listings = %v, want unsettled", err) |
| + } |
| +} |
| + |
| +// P2 #2: a follower created after the check passed, before the pointer is |
| +// deleted, refuses the retire, and the pointer survives. |
| +func TestRetireRefusesRecordCreatedBeforeDelete(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + shipAndPromote(t, tb.fx, tb.sqid, "shop", "v4", "canary/rc") |
| + tb.create(t, tb.token, tb.sqid, "shop", remoteHost, "uk", "stable") |
| + tb.reconcile(t, "v3") |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) |
| + ageRecords(t, tb) |
| + tb.fx.srv.boxReports.expire() |
| + tb.fx.srv.retireBeforeDeleteHook = followerRecord(t, tb, "late.shop.example.com") |
| + if page := retireRC(t, tb); !strings.Contains(page, notSettled) || !rcPointer(t, tb) { |
| + t.Fatalf("retire with a follower created before the delete:\n%s", page) |
| + } |
| + // With nothing happening in between, the same retire goes through. |
| + tb.fx.srv.retireBeforeDeleteHook = nil |
| + if err := tb.fx.rel.Delete(context.Background(), provision.RecordKey(tb.sqid, "shop", "late.shop.example.com")); err != nil { |
| + t.Fatal(err) |
| + } |
| + ageRecords(t, tb) |
| + if page := retireRC(t, tb); !strings.Contains(page, "Retired canary rc") { |
| + t.Fatalf("retire with no change during the check:\n%s", page) |
| + } |
| +} |
| + |
| +// A box report generated before this account's record existed is about an |
| +// earlier owner of the hostname, whoever it names: nothing of it joins. |
| +func TestRemoteReportOlderThanRecordIgnored(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + tb.create(t, tb.token, tb.sqid, "shop", remoteHost, "uk", "") |
| + tb.reconcile(t, "v8") |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now().Add(-2*time.Minute), nil, 9216) |
| + row := instanceRow(t, tb.page(t, "/apps/shop/instances"), remoteHost) |
| + if strings.Contains(row, "v8") { |
| + t.Fatalf("a report older than the record was joined: %s", row) |
| + } |
| + if ov := tb.page(t, "/apps/shop"); strings.Contains(ov, "9.0 KB") { |
| + t.Fatalf("overview joined a report older than the record:\n%s", ov) |
| + } |
| +} |
| + |
| +// P1 #1, `carlos instances list`: the only sample is a successor's, newer |
| +// than the report that vouched for this account; it does not make the |
| +// record Running. |
| +func TestRemoteInstancesListIgnoresSuccessorSample(t *testing.T) { |
| + tb := newTwoBoxes(t) |
| + tb.create(t, tb.token, tb.sqid, "shop", remoteHost, "uk", "") |
| + tb.reconcile(t, "v3") |
| + time.Sleep(1100 * time.Millisecond) |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) |
| + time.Sleep(1100 * time.Millisecond) |
| + sweep(t, tb.fx.rel, status.Label("box-b"), map[string]metrics.UnitSample{ |
| + "carlos-exec@" + remoteHost: {CPUFrac: p(0.66), MemBytes: pi64(7 << 20)}, |
| + }) |
| + if code, _, out := rawReq(t, http.MethodGet, instancesURL(tb.fx, tb.sqid, "shop"), tb.token, ""); code != http.StatusOK || strings.Contains(out, `"health":"Running"`) { |
| + t.Fatalf("instances list = %d %s: a successor's sample made it Running", code, out) |
| + } |
| +} |
diff --git a/internal/console/remoteinstances_test.go b/internal/console/remoteinstances_test.go| index 899c712d7..df9f0f6b3 100644 |
| --- a/internal/console/remoteinstances_test.go |
| +++ b/internal/console/remoteinstances_test.go |
| @@ -11,6 +11,7 @@ package console |
| import ( |
| "context" |
| + "encoding/json" |
| "fmt" |
| "net/http" |
| "net/url" |
| @@ -25,6 +26,7 @@ import ( |
| "github.com/carlosframework/platform/internal/provision" |
| "github.com/carlosframework/platform/internal/registry" |
| "github.com/carlosframework/platform/internal/release" |
| + "github.com/carlosframework/platform/internal/rollout" |
| "github.com/carlosframework/platform/internal/status" |
| ) |
| @@ -147,10 +149,13 @@ func (tb *twoBoxes) reconcile(t *testing.T, version string) { |
| } |
| } |
| -// report writes box's status snapshot from its own registry: what the |
| +// report writes box's status snapshot from its own registry, what the |
| // agent's status tick does (CollectBox over the registry and its aliases), |
| -// with the rollout report naming each provisioned route's own tenant, and |
| -// a database size for each route. |
| +// and its edges file. The rollout report names the tenant of exactly the |
| +// routes production's rollout manages (rollout.Managed: never a static, a |
| +// non-hibernating or a unit-backed route); the edges file names the owner |
| +// of every route, as internal/host's servedOwners publishes it. Each route |
| +// gets a database size. |
| func report(t *testing.T, rel release.Store, reg *registry.Registry, machine, region string, at time.Time, awake map[string]bool, dbBytes int64) string { |
| t.Helper() |
| routes, err := reg.List() |
| @@ -163,7 +168,7 @@ func report(t *testing.T, rel release.Store, reg *registry.Registry, machine, re |
| } |
| ro := &status.RolloutReport{Hosts: map[string]status.HostRollout{}} |
| for _, rt := range routes { |
| - if rt.Provisioned { |
| + if rollout.Managed(rt) { |
| ro.Hosts[rt.Host] = status.HostRollout{Account: rt.Account, App: rt.App, Installed: rt.Version, Awake: awake[rt.Host]} |
| } |
| } |
| @@ -172,9 +177,30 @@ func report(t *testing.T, rel release.Store, reg *registry.Registry, machine, re |
| if err := status.WriteBox(context.Background(), rel, b); err != nil { |
| t.Fatal(err) |
| } |
| + writeEdges(t, rel, b.Label, region, routes) |
| return b.Label |
| } |
| +// writeEdges writes box's edges file in the shape internal/host publishes: |
| +// every route it serves, as home, with the account and app that own it. |
| +func writeEdges(t *testing.T, rel release.Store, label, region string, routes []registry.Route) { |
| + t.Helper() |
| + hosts := map[string]any{} |
| + for _, rt := range routes { |
| + hosts[rt.Host] = map[string]any{"role": "home", "platform": rt.Platform, "account": release.RouteAccount(rt), "app": rt.App} |
| + } |
| + body, err := json.Marshal(map[string]any{"v": 1, "box": label, "eip": "203.0.113.10", "region": region, |
| + "generation": time.Now().UTC().Format(time.RFC3339), "hosts": hosts}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + key := "control/edges/" + label + ".json" |
| + _, etag, _ := rel.Get(context.Background(), key) |
| + if _, err := rel.Put(context.Background(), key, body, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| // sweep writes box's metrics chunk: one exec-child unit per host given, |
| // sampled now (after the instances it reads were created: earlier samples |
| // of a hostname are not its current owner's, ownerAppMetricsFrom). |
| @@ -224,11 +250,13 @@ func (tb *twoBoxes) setUp(t *testing.T, local bool) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - report(t, tb.fx.rel, regA, "box-a", "ie", time.Now(), nil, 1024) |
| - report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) |
| + // The sample first, then the reports, as on a box: a remote row's |
| + // readings are bounded by when its box's report vouched for its owner. |
| sweep(t, tb.fx.rel, status.Label("box-b"), map[string]metrics.UnitSample{ |
| "carlos-exec@" + remoteHost: {CPUFrac: p(0.27), MemBytes: pi64(3 << 20)}, |
| }) |
| + report(t, tb.fx.rel, regA, "box-a", "ie", time.Now(), nil, 1024) |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 4096) |
| } |
| // TestRemoteInstanceMintsOnlyOnItsBox pins the fixture itself: the record |
| @@ -382,12 +410,12 @@ func TestRemoteInstanceCrossAccount(t *testing.T) { |
| const rivalHost = "uk.rival.example.net" |
| tb.create(t, bob, rival, "shop", rivalHost, "uk", "") |
| tb.setUp(t, false) |
| - // B's report now carries both tenants; the sweep both units. |
| - report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 9216) |
| + // The sweep carries both units; B's report, after it, both tenants. |
| sweep(t, tb.fx.rel, status.Label("box-b"), map[string]metrics.UnitSample{ |
| "carlos-exec@" + remoteHost: {CPUFrac: p(0.27), MemBytes: pi64(3 << 20)}, |
| "carlos-exec@" + rivalHost: {CPUFrac: p(0.66), MemBytes: pi64(7 << 20)}, |
| }) |
| + report(t, tb.fx.rel, tb.regB, "box-b", "uk", time.Now(), nil, 9216) |
| if rt, _ := tb.regB.Get(rivalHost); rt == nil { |
| t.Fatal("fixture: box B did not mint the rival's instance") |
| } |
| @@ -430,16 +458,16 @@ func TestRemoteReportNamingAnotherTenant(t *testing.T) { |
| }}, |
| }}} |
| f := foldFleetReports(boxes, true, now) |
| - if rep := f.pick("h.example.com", "mine", "shop"); rep != nil { |
| + if rep := f.pick("h.example.com", "mine", "shop", time.Time{}); rep != nil { |
| t.Fatalf("joined a report naming another account: %+v", rep) |
| } |
| - if rep := f.pick("h.example.com", "other", "web"); rep != nil { |
| + if rep := f.pick("h.example.com", "other", "web", time.Time{}); rep != nil { |
| t.Fatalf("joined a report naming another app: %+v", rep) |
| } |
| - if rep := f.pick("h.example.com", "other", "shop"); rep == nil || rep.version != "v7" || !rep.awake { |
| + if rep := f.pick("h.example.com", "other", "shop", time.Time{}); rep == nil || rep.version != "v7" || !rep.awake { |
| t.Fatalf("the named tenant's own report = %+v", rep) |
| } |
| - rv, dv := remoteRoute(provision.Record{Host: "h.example.com", App: "shop", Account: "mine"}, f.pick("h.example.com", "mine", "shop"), f, "mine", DNSTargets{}) |
| + rv, dv := remoteRoute(provision.Record{Host: "h.example.com", App: "shop", Account: "mine"}, f.pick("h.example.com", "mine", "shop", time.Time{}), f, "mine", DNSTargets{}) |
| // The host is served (by someone else), so it is not "not minted |
| // anywhere" either: unknown, with nothing joined. |
| if rv.Version != "" || rv.dbBytes != nil || rv.boxAwake || rv.Status != "" || !rv.unknown || dv.TLS != "" || dv.Guidance != "" { |
| @@ -455,13 +483,13 @@ func TestRemoteReportStaleAndMoving(t *testing.T) { |
| stale := status.Box{GeneratedAt: now.Add(-time.Hour), Label: "old", Metrics: &status.BoxMetrics{ |
| RouteVersions: map[string]string{"h.example.com": "v1"}}} |
| f := foldFleetReports([]status.Box{stale}, true, now) |
| - rv, _ := remoteRoute(provision.Record{Host: "h.example.com", App: "shop", Account: "a"}, f.pick("h.example.com", "a", "shop"), f, "a", DNSTargets{}) |
| + rv, _ := remoteRoute(provision.Record{Host: "h.example.com", App: "shop", Account: "a"}, f.pick("h.example.com", "a", "shop", time.Time{}), f, "a", DNSTargets{}) |
| if rv.Version != "" || rv.Status != "pending" { |
| t.Fatalf("a stale report was joined: %+v", rv) |
| } |
| // Incomplete read: not "Setting up", and the overview can't tell. |
| f = foldFleetReports([]status.Box{stale}, false, now) |
| - rv, dv := remoteRoute(provision.Record{Host: "h.example.com", App: "shop", Account: "a"}, f.pick("h.example.com", "a", "shop"), f, "a", DNSTargets{}) |
| + rv, dv := remoteRoute(provision.Record{Host: "h.example.com", App: "shop", Account: "a"}, f.pick("h.example.com", "a", "shop", time.Time{}), f, "a", DNSTargets{}) |
| if rv.Status != "" { |
| t.Fatalf("an incomplete read vouched for absence: %+v", rv) |
| } |
| @@ -479,7 +507,7 @@ func TestRemoteReportStaleAndMoving(t *testing.T) { |
| RouteVersions: map[string]string{"h.example.com": "v3"}, |
| Rollout: &status.RolloutReport{Hosts: map[string]status.HostRollout{"h.example.com": {Account: "a", App: "shop"}}}}} |
| f = foldFleetReports([]status.Box{older, newerNoTenant, newer}, true, now) |
| - if rep := f.pick("h.example.com", "a", "shop"); rep == nil || rep.version != "v3" { |
| + if rep := f.pick("h.example.com", "a", "shop", time.Time{}); rep == nil || rep.version != "v3" { |
| t.Fatalf("move in flight picked %+v, want the freshest report naming the tenant (v3)", rep) |
| } |
| } |
diff --git a/internal/console/server.go b/internal/console/server.go| index 75604a211..7f8027da5 100644 |
| --- a/internal/console/server.go |
| +++ b/internal/console/server.go |
| @@ -17,6 +17,7 @@ import ( |
| "html/template" |
| "io" |
| "log" |
| + "maps" |
| "math" |
| mrand "math/rand/v2" |
| "net" |
| @@ -1192,6 +1193,9 @@ type Server struct { |
| // (remoteinstances.go), held for boxReportTTL so the app pages ask the |
| // bucket at most once a minute however many people browse. |
| boxReports boxReportCache |
| + // retireBeforeDeleteHook, when set, runs in the canary retire between |
| + // the follower check and the final record comparison. Tests only. |
| + retireBeforeDeleteHook func() |
| // startedAt overrides when this console started (zero: the process |
| // start, processStart; tests set it), and deletions is when it last |
| // began deleting an instance or sidecar record of each app (acct + "/" |
| @@ -3537,6 +3541,7 @@ func (s *Server) appResourceMetrics(ctx context.Context, view *AppView, acct *Ac |
| unitByHost := make(map[string]string, len(view.Routes)) |
| boxByHost := map[string]string{} |
| sinceByHost := map[string]time.Time{} |
| + untilByHost := map[string]time.Time{} |
| for _, rt := range view.Routes { |
| if rt.Account != acct.Sqid { |
| continue |
| @@ -3558,6 +3563,7 @@ func (s *Server) appResourceMetrics(ctx context.Context, view *AppView, acct *Ac |
| continue |
| } |
| boxByHost[rt.Host] = rt.metricsBox |
| + untilByHost[rt.Host] = rt.until |
| } |
| hosts = append(hosts, rt.Host) |
| hib[rt.Host] = rt.Hibernate |
| @@ -3565,7 +3571,7 @@ func (s *Server) appResourceMetrics(ctx context.Context, view *AppView, acct *Ac |
| unitByHost[rt.Host] = rt.Unit |
| } |
| } |
| - am, err := s.ownerAppMetricsFrom(ctx, hosts, unitByHost, boxByHost, sinceByHost) |
| + am, err := s.ownerAppMetricsFrom(ctx, hosts, unitByHost, boxByHost, sinceByHost, untilByHost) |
| if err != nil { |
| log.Printf("console: app metrics %s: %v", view.App, err) |
| return nil |
| @@ -5460,7 +5466,14 @@ func (s *Server) handleRetireCanary(w http.ResponseWriter, r *http.Request) { |
| // strand every host on it. Fail CLOSED on a registry error — an "I |
| // couldn't check" must never be read as "nobody follows this channel". |
| checkCtx, cancelCheck := context.WithTimeout(r.Context(), 15*time.Second) |
| - hosts, err := s.channelHosts(checkCtx, acct.Sqid, app, channel) |
| + // The app's records as they stand before the check, compared again just |
| + // before the delete: no lock covers record writes, so a record created, |
| + // changed or deleted in between refuses the retire (recordStamps). |
| + before, err := s.recordStamps(checkCtx, acct.Sqid, app) |
| + var hosts []string |
| + if err == nil { |
| + hosts, err = s.channelHosts(checkCtx, acct.Sqid, app, channel) |
| + } |
| cancelCheck() |
| if errors.Is(err, errRetireUnsettled) { |
| // Nobody follows the channel by any record, but the app changed too |
| @@ -5494,9 +5507,25 @@ func (s *Server) handleRetireCanary(w http.ResponseWriter, r *http.Request) { |
| s.confirmRetireCanary(w, r, addr, raw, acct, role, app, name) |
| return |
| } |
| - if err := s.appMutation(ctx, acct, app, "canary-retire", func(ctx context.Context) error { |
| + err = s.appMutation(ctx, acct, app, "canary-retire", func(ctx context.Context) error { |
| + if h := s.retireBeforeDeleteHook; h != nil { |
| + h() |
| + } |
| + after, err := s.recordStamps(ctx, acct.Sqid, app) |
| + if err != nil { |
| + return err |
| + } |
| + if !maps.Equal(before, after) { |
| + return fmt.Errorf("%w: the app's records changed during the check", errRetireUnsettled) |
| + } |
| return s.cfg.Releases.Delete(ctx, key) |
| - }); err != nil { |
| + }) |
| + if errors.Is(err, errRetireUnsettled) { |
| + log.Printf("console: retire %s %s: %v", app, channel, err) |
| + back("err", "Could not verify no hosts follow this channel — try again.") |
| + return |
| + } |
| + if err != nil { |
| log.Printf("console: retire %s %s: %v", app, channel, err) |
| back("err", "Retiring the canary failed: "+err.Error()) |
| return |
diff --git a/internal/console/view.go b/internal/console/view.go| index ade7e342f..5742ddcda 100644 |
| --- a/internal/console/view.go |
| +++ b/internal/console/view.go |
| @@ -395,6 +395,12 @@ type RouteView struct { |
| // could not be read has an unknown start, so it shows nothing rather |
| // than the whole window. Only a hand route with no record is unbounded. |
| bounded bool |
| + // until is when the box report this remote row joined observed the |
| + // host as this account's: samples after it are not proven to be this |
| + // owner's (the hostname may have changed hands since), so they do not |
| + // join. Zero on a local row (no upper bound) and on a remote row with |
| + // no accepted report (no readings at all). |
| + until time.Time |
| } |
| // humanizeCaps renders a registry.Route.Caps column for a person: the |
| @@ -725,7 +731,7 @@ func addRemoteRows(remote *remoteRows, acct, app string, localHosts map[string]b |
| } |
| continue |
| } |
| - rv, dv := remoteRoute(rec, remote.reports.pick(rec.Host, acct, app), remote.reports, acct, dns) |
| + rv, dv := remoteRoute(rec, remote.reports.pick(rec.Host, acct, app, rec.CreatedAt), remote.reports, acct, dns) |
| routes = append(routes, rv) |
| domains = append(domains, dv) |
| added = true |
diff --git a/internal/provision/console_remote_instances_census_test.go b/internal/provision/console_remote_instances_census_test.go| index 63a7da025..0393864eb 100644 |
| --- a/internal/provision/console_remote_instances_census_test.go |
| +++ b/internal/provision/console_remote_instances_census_test.go |
| @@ -28,6 +28,12 @@ package provision |
| // deletions, each note the app in the canary-retire guard's in-memory |
| // deletion log before deleting (noteRecordDeletion); their deletes and |
| // classes are unchanged. |
| +// - Round 4 review: Server.recordStamps is new, listing RecordsPrefix and |
| +// SidecarsPrefix with modification times for the canary retire's |
| +// before/after comparison; Server.retireUnsettled refuses a key the |
| +// follower read did not see; Server.pageRecords reads the bucket, not |
| +// the record view, for an app the console just deleted a record of. |
| +// None writes anything: key-site. |
| // - Server.pageRecords is new (round 1 review): the app pages' record |
| // reader. It lists RecordsPrefix for the viewed account's app and reads |
| // each record not already a local row with GetRecord, through the |
| @@ -41,8 +47,9 @@ func consoleRemoteInstancesWriteCensusInventory() []censusEntry { |
| {"internal/console/apiinstanceimport.go", "Server.deleteRead", "key-site", "key:RecordKey", "10452daaaf26912a51748001af6d1c801726b80c1167b22815e70f41c04c9552"}, |
| {"internal/console/seedfinish.go", "Server.finishSeedOnce", "key-site", "key:RecordKey", "55c0cd69496dbc7c5339ea9374d90da70864d5c6f8a33e613351e290988c1e72"}, |
| {"internal/console/claim_retire.go", "Server.retireClaimHostRecord", "key-site", "key:claimRetireRecordKey", "3c30cfcad8f2edb3c38b7dd9e56697cd3e17ce3a7fa0e76eb815adf3dad7bd4d"}, |
| - {"internal/console/remoteinstances.go", "Server.retireUnsettled", "key-site", "key:RecordsPrefix,key:SidecarsPrefix", "8aa2e4063634cd4d643fc22982baa79845b73410eeef500e228ffa29b00d6c3f"}, |
| - {"internal/console/remoteinstances.go", "Server.pageRecords", "key-site", "key:RecordsPrefix", "b03ec08af6e2eedc5b2fa269751b5fa3465c2e728c93a6c97964ebabb15362a4"}, |
| + {"internal/console/remoteinstances.go", "Server.retireUnsettled", "key-site", "key:RecordsPrefix,key:SidecarsPrefix", "46f74063782140e59d2acf3c57cd32784b1b2fca069e23a3c00bf961a324da5d"}, |
| + {"internal/console/remoteinstances.go", "Server.pageRecords", "key-site", "key:RecordsPrefix", "5298e5713404c168fdc4cfdc9995f57a5d3d61893d4b6c17f985877de59f8896"}, |
| + {"internal/console/remoteinstances.go", "Server.recordStamps", "key-site", "key:RecordsPrefix,key:SidecarsPrefix", "c38f120e5be0e8c883b6da7d86df23a5b6b495a31732732e6cbe6efe5821ff43"}, |
| } |
| for _, r := range replacements { |
| found := false |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index bd8054007..f6fd191c1 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -23,4 +23,4 @@ plan14-root-reads-plans-4a-store.tsv 72dc835c04caf5b2b49cc6ecbfd865bb3123b997ee9 |
| plan14-root-reads-plans-4-notices-grace.tsv 43e430a3b3edf9333bfe2c64f24ca9e4c04475dc45ae4983d4e8bcab6a9c0bc4 |
| plan14-root-reads-design-edge-rate-limit-358-decisions.tsv a067dcd9e32e6be2b7dd9c6a8256d1252ac4c737fd058c430823e382add340c4 |
| plan14-root-reads-design-edge-rate-limit-358.tsv 0c4eabfe38e12b098285bdeb5ceb0b16e5333928f5b02e160a6b16b5fd9ce1e0 |
| -plan14-root-reads-console-remote-instances.tsv 5114dd8af8a2c60628d0b161b210f4cff1eca7adb1a1e5f01408a6f4590c74fd |
| +plan14-root-reads-console-remote-instances.tsv b173449e9f3369a83c6475acbbae8afba61660b7f77ecf5535e8c8ce7031ca94 |
diff --git a/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv b/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv| index ecfa44fea..b56cb38d0 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv |
| @@ -1,25 +1,25 @@ |
| # Census overlay console-remote-instances, written by census-propose (#369). census-ruling-console-remote-instances, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-console-remote-instances.md. |
| # 9 body, 2 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| @legacy d0a3ae6c1eb6795c3810264874e4f1363432cbdd3aae6398e30422c7169a3726 internal/console/accountfleet.go Server.assembleAccountFleet legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Fleet tab: the shared-fleet app count also reads the account's own instance records (per app of the account, under its own prefix, region not a fleet placement); the registry read is unchanged. registry:Account@2350,registry:Account@4421,registry:App@2476,registry:Name@4814,registry:Region@2437,whole:Fleet@4006,whole:Fleet@4408,whole:Fleet@4522,whole:Route@2335 1b5ecf4066d067d721683d273e768d834df0bb9cb3cf5ff90648b1e6842bacc8 |
| -@legacy ab2c0cc1b9d16b0522527bc6b8cbf9927f78d0621057469bbc98bccd254fb40e internal/console/apiinstances.go Server.healthByHost legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Takes an awake set, a box pin per host and an ownership start per host from the caller (readings only from that box and only from samples at or after the start, via ownerAppMetricsFrom); registry reads unchanged. registry:Backing@1253,registry:Hibernate@1175,registry:Kind@1158,registry:Provisioned@1228,registry:Status@1035,registry:Unit@1244,registry:Unit@381,registry:Unit@416,whole:Route@1012,whole:Route@229,whole:Route@272,whole:Route@338 b6d1d75b2228a97cba475d87730c7cae3f48774ed973083dff0ef798263e613d |
| -@legacy a7ae52378a61d71162c98d6bfe643f3090fab3eb6bbb5ceb4092516fb7b59912 internal/console/apiroutes.go Server.handleAPIRoutes legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Passes nil for healthByHost's new awake, box-pin and ownership-start arguments; nothing else. registry:Account@4614,registry:App@1646,registry:App@2114,registry:App@4553,registry:Backing@2274,registry:Canary@2412,registry:Channel@2134,registry:Environment@2159,registry:Hibernate@2233,registry:Host@1730,registry:Host@2056,registry:Host@2212,registry:Host@2368,registry:Host@4686,registry:Host@4766,registry:Kind@2071,registry:Platform@2397,registry:Prefix@4782,registry:Provisioned@2299,registry:Replication@2331,registry:Status@2183,registry:Target@4800,registry:Unit@2253,whole:Route@1635,whole:Route@1684,whole:Route@1721,whole:Route@1741,whole:Route@1861,whole:Route@1973,whole:Route@2004,whole:Route@2104,whole:Route@4677,whole:RoutePath@3619 2b37acd8b5b5ddf6dcebaac0588bf44ed750b9fad749eb8cc46bd69875d774a4 |
| -@legacy c0d2c59598528083dfe56c7618bdcb79c0b1ea5e65e64d9c93d472d01093c5f7 internal/console/claim_retire.go Server.retireClaimHostRecord legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Notes the app in the console's in-memory deletion log (noteRecordDeletion) before retiring a record, for the canary-retire guard; the retire itself is unchanged. file:Read@941 3c30cfcad8f2edb3c38b7dd9e56697cd3e17ce3a7fa0e76eb815adf3dad7bd4d |
| +@legacy 5d23e3044287253a4ff2e8ef1bd1ea50e2f4682485ba794d7c9d5635c8a24584 internal/console/apiinstances.go Server.healthByHost legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Takes an awake set, a box pin per host and an ownership window per host (since, until) from the caller: readings only from that box and only from samples inside the window, via ownerAppMetricsFrom; registry reads unchanged. registry:Backing@1279,registry:Hibernate@1201,registry:Kind@1184,registry:Provisioned@1254,registry:Status@1061,registry:Unit@1270,registry:Unit@394,registry:Unit@429,whole:Route@1038,whole:Route@242,whole:Route@285,whole:Route@351 6d4e71f0460632bec27b64b948c6bea4fdf48c2ff5c15c252614a46643b81924 |
| +@legacy 6aca486aeff4e98674d40cac55e1ed92f45045a178c212f3ed3be6e106ad8bde internal/console/apiroutes.go Server.handleAPIRoutes legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Passes nil for healthByHost's new awake, box-pin and ownership-window arguments; nothing else. registry:Account@4619,registry:App@1646,registry:App@2119,registry:App@4558,registry:Backing@2279,registry:Canary@2417,registry:Channel@2139,registry:Environment@2164,registry:Hibernate@2238,registry:Host@1730,registry:Host@2061,registry:Host@2217,registry:Host@2373,registry:Host@4691,registry:Host@4771,registry:Kind@2076,registry:Platform@2402,registry:Prefix@4787,registry:Provisioned@2304,registry:Replication@2336,registry:Status@2188,registry:Target@4805,registry:Unit@2258,whole:Route@1635,whole:Route@1684,whole:Route@1721,whole:Route@1741,whole:Route@1861,whole:Route@1978,whole:Route@2009,whole:Route@2109,whole:Route@4682,whole:RoutePath@3624 b4c691f072d0c7d829aba6a5302cf95fe36abf2596d5060064493b49af80c35f |
| +@legacy e096052196bcd47b52cd721741d73c701d59e2f0d6a0a0a0cf9c4b33a1636bf1 internal/console/claim_retire.go Server.retireClaimHostRecord legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Notes the app in the console's in-memory deletion log (noteRecordDeletion, which also invalidates the pages' held box reports) before retiring a record, for the canary-retire guard; the retire itself is unchanged. file:Read@941 3c30cfcad8f2edb3c38b7dd9e56697cd3e17ce3a7fa0e76eb815adf3dad7bd4d |
| @legacy 68455015fbe9d2db598f2616aa59f01bda880869dbee9d7b61b65506624f6e42 internal/console/instancepage.go Server.handleAppInstance legacy accepted-legacy accepted-legacy;rev3=merge-ruling-2;basis=Instance page adds updates view from rollout join; browser rendering remains legacy.;rev3=census-ruling-console-remote-instances;basis=A remote row (no local registry row) takes its aliases from its box report; local rows read ListAliases as before. file:Query@2672,registry:Account@2444,registry:Alias@2544,registry:App@2474,registry:Host@2422,whole:RouteAlias@2405 07f5c01659b0d453d5996abb6a6e9493f74c7df97e3cddfe0f765b6f316de4a7 |
| @legacy aa852aec334f46af0b4bb16f7f81afa3d4690f0f12c6c80b2ab5cff4837367aa internal/console/metricsview.go buildUnitRows legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Each unit row also keeps its raw per-sample readings (float32 CPU, int64 memory) so an owner's graph can be redrawn from only their samples; reads nothing new. file:ReadBytes@315,file:ReadBytes@327 e7f942ea8d32626b6ead3313deec26c458a7d7c296e7120c7384dfc5f416c378 |
| -@legacy 6366e141d2beaefbc50930cded49314ca0242bfef8403f80351ccbdeeab8908f internal/console/server.go Server.channelHosts legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Canary-retire guard also counts the account's instance records (ListRecordsStrict) and sidecar records (listed, then each read with GetSidecarRecord; any read error refuses) naming the channel; with none, it refuses unless the app has settled (retireUnsettled: no record created, changed or deleted within channelSettle, every box report read, no box serving a host of the app that no record names). The registry read is as on main. Fails closed. registry:App@424,registry:Channel@441,registry:Host@472,whole:Route@410 966e1fb668d3910ccb102845f1c5c91a1aa2cfa857bbf0ca11d850945259c682 |
| +@legacy 5ba3b725e417106dfbca90c2d28ca0ff116430d0ec8dcbdf9533464cbeda380b internal/console/server.go Server.channelHosts legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Canary-retire guard also counts the account's instance records (ListRecordsStrict) and sidecar records (listed, then each read with GetSidecarRecord; any read error refuses) naming the channel; with none, it refuses unless the app has settled (retireUnsettled). The registry read is as on main. Fails closed. registry:App@424,registry:Channel@441,registry:Host@472,whole:Route@410 966e1fb668d3910ccb102845f1c5c91a1aa2cfa857bbf0ca11d850945259c682 |
| @legacy 9c63018a0c60a52c55b2ef0159bc58cbf0f191e0166a53adf58feff954c6935e internal/console/templates/app_overview.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Running tile does not claim Served when a route's state is unknown and reads the existing 'no data right now' when every instance's state is unknown; Web addresses tile reads 'no data right now' instead of 'DNS & certs OK' for a domain with no reading; display only. file:external@0 2a112ff768c300894881b858e61465841c87810ca7cb1d98a0fe2a54155a0ca1 |
| -@legacy 73dedec8e8eba8cad40da63a9dcd22d01688bcc8d89f8f5b2fd8f7080f04d46f internal/console/apiinstances.go Server.instanceHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Records with no local registry row get health only from a box report naming the record's own account and app (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by each record's created_at. Builds registry.Route literals from the record; reads no registry for them. registry:Account@1987,registry:Account@2007,registry:App@1948,registry:App@1964,registry:Host@839,registry:Unit@2117,registry:Unit@2159,whole:Route@1151,whole:Route@2054,whole:Route@2075,whole:Route@2854,whole:Route@3646,whole:Route@4126,whole:Route@4179,whole:Route@4294,whole:Route@792,whole:Route@821,whole:Route@832,whole:Route@850 f2b042a95c77b07f0bcd1c11f099769a7ad3c1a230c521af71c6bf5cb7685897 |
| +@legacy cba56de76bf077c160affcd94c48b66d948eeed985cc78e9845fb2bb4620f0b0 internal/console/apiinstances.go Server.instanceHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Records with no local registry row get health only from a box report (rollout entry or edges-file owner) naming the record's own account and app and generated after the record existed (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by the record's created_at and the report's observation. Builds registry.Route literals from the record; reads no registry for them. registry:Account@1987,registry:Account@2007,registry:App@1948,registry:App@1964,registry:Host@839,registry:Unit@2117,registry:Unit@2159,whole:Route@1151,whole:Route@2054,whole:Route@2075,whole:Route@2893,whole:Route@3649,whole:Route@4166,whole:Route@4219,whole:Route@4334,whole:Route@792,whole:Route@821,whole:Route@832,whole:Route@850 5824a71a58f5869ec8f0f90878b939d5a900399f42a504d6cc4c33210d55be6c |
| @legacy c4f85bcfbab5b09688918bfefae1eff1b8bf54e2659428cf33c2d4bafc9729ab internal/console/view.go Assemble legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Collects the set of local registry hosts (rt.Host) so a record host the registry has gets no remote row (its record's created_at bounds the local row's metrics history); adds rows from the account's records and tenant-named box reports when given a remote source. registry:App@1716,registry:App@1739,registry:App@2117,registry:App@2147,registry:Backing@2017,registry:Caps@1385,registry:Channel@960,registry:Environment@1942,registry:Hibernate@1859,registry:Host@1768,registry:Host@861,registry:Kind@1783,registry:Platform@1889,registry:Provisioned@2042,registry:Status@1800,registry:Unit@1999,registry:Version@1823,whole:Route@2092,whole:Route@2167,whole:Route@810,whole:Route@839,whole:Route@910 120ae8c042523f872fd1c19357b8bb830e4afe9da1e38ad202df2ada3ad52ada |
| internal/console/accountfleet.go Server.assembleAccountFleet legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Fleet tab: the shared-fleet app count also reads the account's own instance records (per app of the account, under its own prefix, region not a fleet placement); the registry read is unchanged. registry:Account@2350,registry:Account@4421,registry:App@2476,registry:Name@4814,registry:Region@2437,whole:Fleet@4006,whole:Fleet@4408,whole:Fleet@4522,whole:Route@2335 1b5ecf4066d067d721683d273e768d834df0bb9cb3cf5ff90648b1e6842bacc8 |
| -internal/console/apiinstances.go Server.healthByHost legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Takes an awake set, a box pin per host and an ownership start per host from the caller (readings only from that box and only from samples at or after the start, via ownerAppMetricsFrom); registry reads unchanged. registry:Backing@1253,registry:Hibernate@1175,registry:Kind@1158,registry:Provisioned@1228,registry:Status@1035,registry:Unit@1244,registry:Unit@381,registry:Unit@416,whole:Route@1012,whole:Route@229,whole:Route@272,whole:Route@338 b6d1d75b2228a97cba475d87730c7cae3f48774ed973083dff0ef798263e613d |
| -internal/console/apiroutes.go Server.handleAPIRoutes legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Passes nil for healthByHost's new awake, box-pin and ownership-start arguments; nothing else. registry:Account@4614,registry:App@1646,registry:App@2114,registry:App@4553,registry:Backing@2274,registry:Canary@2412,registry:Channel@2134,registry:Environment@2159,registry:Hibernate@2233,registry:Host@1730,registry:Host@2056,registry:Host@2212,registry:Host@2368,registry:Host@4686,registry:Host@4766,registry:Kind@2071,registry:Platform@2397,registry:Prefix@4782,registry:Provisioned@2299,registry:Replication@2331,registry:Status@2183,registry:Target@4800,registry:Unit@2253,whole:Route@1635,whole:Route@1684,whole:Route@1721,whole:Route@1741,whole:Route@1861,whole:Route@1973,whole:Route@2004,whole:Route@2104,whole:Route@4677,whole:RoutePath@3619 2b37acd8b5b5ddf6dcebaac0588bf44ed750b9fad749eb8cc46bd69875d774a4 |
| -internal/console/claim_retire.go Server.retireClaimHostRecord legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Notes the app in the console's in-memory deletion log (noteRecordDeletion) before retiring a record, for the canary-retire guard; the retire itself is unchanged. file:Read@941 3c30cfcad8f2edb3c38b7dd9e56697cd3e17ce3a7fa0e76eb815adf3dad7bd4d |
| +internal/console/apiinstances.go Server.healthByHost legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Takes an awake set, a box pin per host and an ownership window per host (since, until) from the caller: readings only from that box and only from samples inside the window, via ownerAppMetricsFrom; registry reads unchanged. registry:Backing@1279,registry:Hibernate@1201,registry:Kind@1184,registry:Provisioned@1254,registry:Status@1061,registry:Unit@1270,registry:Unit@394,registry:Unit@429,whole:Route@1038,whole:Route@242,whole:Route@285,whole:Route@351 6d4e71f0460632bec27b64b948c6bea4fdf48c2ff5c15c252614a46643b81924 |
| +internal/console/apiroutes.go Server.handleAPIRoutes legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Passes nil for healthByHost's new awake, box-pin and ownership-window arguments; nothing else. registry:Account@4619,registry:App@1646,registry:App@2119,registry:App@4558,registry:Backing@2279,registry:Canary@2417,registry:Channel@2139,registry:Environment@2164,registry:Hibernate@2238,registry:Host@1730,registry:Host@2061,registry:Host@2217,registry:Host@2373,registry:Host@4691,registry:Host@4771,registry:Kind@2076,registry:Platform@2402,registry:Prefix@4787,registry:Provisioned@2304,registry:Replication@2336,registry:Status@2188,registry:Target@4805,registry:Unit@2258,whole:Route@1635,whole:Route@1684,whole:Route@1721,whole:Route@1741,whole:Route@1861,whole:Route@1978,whole:Route@2009,whole:Route@2109,whole:Route@4682,whole:RoutePath@3624 b4c691f072d0c7d829aba6a5302cf95fe36abf2596d5060064493b49af80c35f |
| +internal/console/claim_retire.go Server.retireClaimHostRecord legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Notes the app in the console's in-memory deletion log (noteRecordDeletion, which also invalidates the pages' held box reports) before retiring a record, for the canary-retire guard; the retire itself is unchanged. file:Read@941 3c30cfcad8f2edb3c38b7dd9e56697cd3e17ce3a7fa0e76eb815adf3dad7bd4d |
| internal/console/instancepage.go Server.handleAppInstance legacy accepted-legacy accepted-legacy;rev3=merge-ruling-2;basis=Instance page adds updates view from rollout join; browser rendering remains legacy.;rev3=census-ruling-console-remote-instances;basis=A remote row (no local registry row) takes its aliases from its box report; local rows read ListAliases as before. file:Query@2672,registry:Account@2444,registry:Alias@2544,registry:App@2474,registry:Host@2422,whole:RouteAlias@2405 07f5c01659b0d453d5996abb6a6e9493f74c7df97e3cddfe0f765b6f316de4a7 |
| internal/console/metricsview.go buildUnitRows legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Each unit row also keeps its raw per-sample readings (float32 CPU, int64 memory) so an owner's graph can be redrawn from only their samples; reads nothing new. file:ReadBytes@315,file:ReadBytes@327 e7f942ea8d32626b6ead3313deec26c458a7d7c296e7120c7384dfc5f416c378 |
| internal/console/metricsview.go type UnitRow diagnostic H3 schema-only;rev3=census-ruling-console-remote-instances;basis=Two unexported fields carrying those raw per-sample readings; schema only. file:ReadBytes@133 db66030c5353fee88e0826786a424e0fee88d3191004deff380d00086bef5d62 |
| -internal/console/server.go Server.channelHosts legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Canary-retire guard also counts the account's instance records (ListRecordsStrict) and sidecar records (listed, then each read with GetSidecarRecord; any read error refuses) naming the channel; with none, it refuses unless the app has settled (retireUnsettled: no record created, changed or deleted within channelSettle, every box report read, no box serving a host of the app that no record names). The registry read is as on main. Fails closed. registry:App@424,registry:Channel@441,registry:Host@472,whole:Route@410 966e1fb668d3910ccb102845f1c5c91a1aa2cfa857bbf0ca11d850945259c682 |
| +internal/console/server.go Server.channelHosts legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Canary-retire guard also counts the account's instance records (ListRecordsStrict) and sidecar records (listed, then each read with GetSidecarRecord; any read error refuses) naming the channel; with none, it refuses unless the app has settled (retireUnsettled). The registry read is as on main. Fails closed. registry:App@424,registry:Channel@441,registry:Host@472,whole:Route@410 966e1fb668d3910ccb102845f1c5c91a1aa2cfa857bbf0ca11d850945259c682 |
| internal/console/templates/app_overview.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Running tile does not claim Served when a route's state is unknown and reads the existing 'no data right now' when every instance's state is unknown; Web addresses tile reads 'no data right now' instead of 'DNS & certs OK' for a domain with no reading; display only. file:external@0 2a112ff768c300894881b858e61465841c87810ca7cb1d98a0fe2a54155a0ca1 |
| -internal/console/apiinstances.go Server.instanceHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Records with no local registry row get health only from a box report naming the record's own account and app (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by each record's created_at. Builds registry.Route literals from the record; reads no registry for them. registry:Account@1987,registry:Account@2007,registry:App@1948,registry:App@1964,registry:Host@839,registry:Unit@2117,registry:Unit@2159,whole:Route@1151,whole:Route@2054,whole:Route@2075,whole:Route@2854,whole:Route@3646,whole:Route@4126,whole:Route@4179,whole:Route@4294,whole:Route@792,whole:Route@821,whole:Route@832,whole:Route@850 f2b042a95c77b07f0bcd1c11f099769a7ad3c1a230c521af71c6bf5cb7685897 |
| +internal/console/apiinstances.go Server.instanceHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Records with no local registry row get health only from a box report (rollout entry or edges-file owner) naming the record's own account and app and generated after the record existed (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by the record's created_at and the report's observation. Builds registry.Route literals from the record; reads no registry for them. registry:Account@1987,registry:Account@2007,registry:App@1948,registry:App@1964,registry:Host@839,registry:Unit@2117,registry:Unit@2159,whole:Route@1151,whole:Route@2054,whole:Route@2075,whole:Route@2893,whole:Route@3649,whole:Route@4166,whole:Route@4219,whole:Route@4334,whole:Route@792,whole:Route@821,whole:Route@832,whole:Route@850 5824a71a58f5869ec8f0f90878b939d5a900399f42a504d6cc4c33210d55be6c |
| internal/console/view.go Assemble legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Collects the set of local registry hosts (rt.Host) so a record host the registry has gets no remote row (its record's created_at bounds the local row's metrics history); adds rows from the account's records and tenant-named box reports when given a remote source. registry:App@1716,registry:App@1739,registry:App@2117,registry:App@2147,registry:Backing@2017,registry:Caps@1385,registry:Channel@960,registry:Environment@1942,registry:Hibernate@1859,registry:Host@1768,registry:Host@861,registry:Kind@1783,registry:Platform@1889,registry:Provisioned@2042,registry:Status@1800,registry:Unit@1999,registry:Version@1823,whole:Route@2092,whole:Route@2167,whole:Route@810,whole:Route@839,whole:Route@910 120ae8c042523f872fd1c19357b8bb830e4afe9da1e38ad202df2ada3ad52ada |
| -@coverage internal/console f77f5c4347463e2b4e812d77a67f129baa19434f45c14f9892032a869bc85c37 |
| +@coverage internal/console c73257bab5d1ed70783d0a5dd5aa5c2af5b1197f38c79295b53577f7be25204a |
| @coverage internal/console/templates 6e272e30e00be5785b3f364a947ea4ab86b2d96a0e8d21821b7812c45f0a636f |