adapter: Align replica hydration history object counts - #38729
Conversation
| does not declare a key or index. Collection runs on the selected replica, so a | ||
| catalog-server index would not avoid importing and arranging the history there. | ||
|
|
||
| `object_count` counts only exports eligible for object hydration history: user |
There was a problem hiding this comment.
let's cut back this change, keep it simple
| | `started_at` | [`timestamp with time zone`] | The earliest maintained compute dataflow installation in the hydration episode. | | ||
| | `finished_at` | [`timestamp with time zone`] | The latest maintained compute dataflow hydration in the hydration episode. | | ||
| | `object_count` | [`uint8`] | The number of maintained compute dataflows in the hydration episode. | | ||
| | `object_count` | [`uint8`] | The number of user index and materialized view dataflows eligible for object hydration history in the episode. Builtin dataflows contribute to episode boundaries but not this count. | |
There was a problem hiding this comment.
le'ts also cut this change, too complicated and we want to keep it simple
| count(*)::uint8 AS object_count | ||
| count(*) FILTER ( | ||
| WHERE object_id LIKE 'u%' | ||
| AND object_id IN ( |
There was a problem hiding this comment.
it's a bit heavy that we need an extra join here. Is there a local way of figuring out which objects to ignore. Which are the 33 objects we're seeing in there on the current version?
| ( | ||
| "object_count", | ||
| "The number of maintained compute dataflows in the hydration episode.", | ||
| "The number of user index and materialized view dataflows eligible for object hydration history in the episode. Builtin dataflows contribute to episode boundaries but not this count.", |
There was a problem hiding this comment.
le'ts cut this change, keep it simple
9062977 to
f3e4bd2
Compare
QA LLM Review1. MEDIUM --
|
| episode_started_at AS started_at, | ||
| max(hydrated_at) AS finished_at, | ||
| count(*)::uint8 AS object_count | ||
| count(*) FILTER (WHERE object_id LIKE 'u%')::uint8 AS object_count |
There was a problem hiding this comment.
This makes object_count read 0 for the builtin-only episode, while the column comment (mz_internal.rs:5237) and the docs row still say "The number of maintained compute dataflows in the hydration episode", and that episode did hydrate 33 dataflows. You cut the longer rewording earlier; a one-word version might still be worth it: "The number of user-created compute dataflows in the hydration episode." Your call.
| # A system-only replica hydration episode covers every visible non-transient | ||
| # export. Its existence also proves the collector excludes its own transient | ||
| # A system-only replica hydration episode has no objects eligible for object | ||
| # history. Its existence also proves the collector excludes its own transient |
There was a problem hiding this comment.
With the assertion now hydrated 0, this sentence no longer follows: a spurious transient-only episode would also read hydrated 0, since t% is not u%. The old form compared against the live non-transient count, which did rule it out. Suggest dropping the sentence, or stating it as a fact about the NOT LIKE 't%' filter rather than as something this assertion proves. (Same point as item 2 of the QA review, independently confirmed.)
| FROM mz_introspection.mz_compute_hydration_times_per_worker AS t | ||
| JOIN mz_internal.mz_object_global_ids AS ids ON ids.global_id = t.export_id | ||
| JOIN mz_catalog.mz_objects AS o ON o.id = ids.id | ||
| WHERE t.export_id LIKE 'u%' |
There was a problem hiding this comment.
nit: collect_requires_every_worker could assert !sql.contains("mz_catalog.mz_objects") and !sql.contains("mz_object_global_ids") the way the replica test does, so the catalog imports (mz_objects alone is an 8-way union) do not creep back into the per-replica dataflow.
Exclude introspection-index and transient exports from both object history and replica episode counts, without catalog lookups. Include ordinary system and user exports while preserving replica episode boundaries and completion checks. Closes: SQL-692
f3e4bd2 to
8ac25e3
Compare
Motivation
Replica hydration history counts builtin introspection indexes that object hydration history excludes. This makes the two histories inconsistent.
Changes
Exclude introspection-index (
si%) and transient (t%) exports from both object history and replica episode counts, without catalog lookups. Ordinary system and user exports are included.Keep all non-transient exports in episode construction, so introspection hydration still determines episode boundaries and completion. Introspection-only episodes remain visible with
object_count = 0.Adjust
hydration-status.tdto require a zero-count introspection-only episode while retaining the exact count and timing assertion for an isolated user-index episode.Closes: SQL-692