console: show real source status on the Objects page - #38379
Conversation
Sources previously showed replica-hydration buckets (Not Hydrated / Hydrating / Running), which misrepresent them: a source's hydrated flag only tracks rehydration_latency, and webhook sources have no hydration rows at all. The status column, filter, and detail badge now show the source's ingestion status via ConnectorStatusPill. Status rides on the hydration-aggregate subscribe, which FULL JOINs mz_source_statuses and carries bool_and(snapshot_committed).
The diagnostics card judged snapshot completion by the staged/known ratio, whose denominator is an estimate, so a current source could show a stuck 99% snapshot next to 1s freshness. The card now keys off the authoritative snapshot_committed flag and renders only when there is something diagnostic to say: a status error or an in-progress snapshot. Steady-state lifecycle facts live on the source details page.
Sources have no Materialize-internal upstream chain, so their Freshness tab showed only the lag chart. It now shows the ingest cluster's replica memory/CPU at the point selected on the graph, including replicas dropped in the window, by extracting the reusable half of the critical-path cluster metrics. Falls back to each replica's latest bucket when the anchor bucket predates a replica swap.
12b46b5 to
f8f00d6
Compare
QA LLM Review1. MEDIUM --
|
Exclude subsources and progress collections, which the UI hides and which multiply the feed's cardinality several times over. Restrict the snapshot_committed aggregate to statistics rows from live replicas (keeping rows with no replica_id, which is how webhook sources report), so a dropped replica's stale row cannot pin a committed source back to snapshotting.
QA LLM Review1. MEDIUM -- Subsources are not excluded from the feed; they re-enter through the hydration side of the FULL JOIN
The new Details
The accompanying test cannot catch this. There is no user-visible change today, because |
Subsources re-entered the feed through the hydration side of the FULL JOIN (they have hydration rows via their parent's cluster), so the exclusion now applies to both sides; the SQL test seeds the hydration-side row that reproduced the leak. The cluster-metrics anchor fallback applied to historical anchors too, presenting present-time replica metrics as the selected timestamp's and silencing the dropped-replicas callout exactly when a past replication-factor-0 window was the answer. The fallback is now gated to now-ish anchors, where an empty bucket means metrics haven't arrived, not that the cluster was inactive. The Status column sorted by hydration ratio while displaying ingestion status for sources; its accessor now sorts by the displayed bucket.
|
Thanks — all four findings addressed:
|
QA LLM Review1. MEDIUM -- Empty anchor bucket makes the footer report live replicas as "dropped in this window"
Gating the fallback on Details
Reaching it is the panel's own diagnostic flow: the default anchor is the object's peak-lag bucket, and a cluster sitting at
|
Motivation
Sources on the maintained-objects (Objects) page were described in replica-hydration terms, which misrepresents them three ways:
Not Hydrated/Hydrating/Runningbuckets derived frommz_hydration_statuses. For a source,hydratedonly tracks whetherrehydration_latencyis set, so a healthy source could readNot Hydrated(Slack: #console, Aug 19 thread on what "Not Hydrated" means).99%snapshot progress next to1sfreshness because completion was judged by the staged/known ratio, whose denominator is an estimate that can sit below 100% forever.Separately, the source detail panel gave no way to see the ingest cluster's resources while diagnosing a lagging source.
Changes
One commit per concern, reviewable in order:
Source ingestion status on the Objects page. The status column, filter, and detail-panel badge show the source's ingestion status (
snapshotting,running,paused,stalled, ...) viaConnectorStatusPill, matching the Sources page. Non-source objects keep the hydration buckets. The filter derives from the same function the cell renders, so it can never offer a value the cell doesn't show. Status rides on the existing hydration-aggregate subscribe: the aggregate now FULL JOINsmz_source_statuses(so webhook sources get a row) and carriesbool_and(snapshot_committed)frommz_source_statistics.Snapshot display keys off
snapshot_committed. The diagnostics card uses the authoritative boolean instead of the staged/known ratio, and now renders only when it has something diagnostic to say: a status error, or an in-progress snapshot (with a per-source-type note that counts are estimates, shared with the Sources page viasnapshotEstimateNote). Steady-state lifecycle facts (rehydration time, messages received) already live on the source details page, so the card no longer duplicates them.Source cluster metrics on the Freshness tab. The detail panel shows the ingest cluster's replica memory/CPU at the point selected on the freshness graph, including replicas dropped in the window (reuses the critical-path cluster metrics via a new shared
ClusterReplicaMetricscomponent; falls back to each replica's latest bucket when the anchor bucket predates a replica swap).Feed hardening. Subsources and progress collections are excluded from the aggregate (the UI hides them, and they multiply the feed's cardinality several times over), and the
snapshot_committedaggregate is restricted to statistics rows from live replicas (keeping null-replica_idrows, which is how webhook sources report), so a dropped replica's stale row cannot pin a committed source back to snapshotting.Tests
Extended
hydrationAggregate.test.sql.tsfor the FULL JOIN,bool_and(snapshot_committed), subsource/progress exclusion, and live-replica semantics, andMaintainedObjects.test.tsxfor the source status column and filter.Closes CNS-97
Closes CNS-82
Closes CNS-85
🤖 Generated with Claude Code