Skip to content

doc: correct the hydration timestamps design against what shipped - #38384

Merged
antiguru merged 1 commit into
mainfrom
claude/hydration-visibility-compute-js1ycm
Aug 21, 2026
Merged

doc: correct the hydration timestamps design against what shipped#38384
antiguru merged 1 commit into
mainfrom
claude/hydration-visibility-compute-js1ycm

Conversation

@antiguru

Copy link
Copy Markdown
Member

Motivation

The design doc merged in #38238 no longer describes main in two places. Both surfaced while reviewing #38344, which builds on this change and describes it, so the two docs currently disagree with each other and one of them disagrees with the code.

Ref: SQL-632

Doc only.

Description

The per-worker log was not renamed. The doc specifies renaming it to mz_compute_hydration_timestamps_per_worker with the old name left behind as a projecting view. What shipped appends the columns to mz_compute_hydration_times_per_worker in place, keeping its name, OID and object kind, so there is no view and SELECT * against it returns a wider row.

The shipped behaviour is the better trade and the doc now argues for it rather than against it. The rename bought only the SELECT * width on an unstable mz_introspection relation, and cost a new OID, a view, and the golden churn from both. Every consumer of that relation selects columns by name: the introspection subscribe, mz-debug, and the goldens, which churn either way. The one consumer that decodes positionally, arrangement_sizes_snapshot, reads the aggregate mz_internal.mz_compute_hydration_times, which neither approach would have touched. Success criterion 7 is narrowed accordingly, since the log did change shape and the original wording promised it would not.

The started_at backfill is a normal path, not a repair. The doc claims the creation-time and handle_schedule stamps cover every way a dataflow can begin computing without a Schedule, so a remaining NULL at hydration is unanticipated and worth a diagnostic. That reasoning is wrong, and the implementation comment says why: having no imports is sufficient to start immediately, but it is not necessary in order to hydrate early. A dataflow that does import can still see its output frontier pass the as-of while suspended, when the arrangement it imports is already hydrated, and a handful of mz_catalog_server indexes do exactly that on every bootstrap.

So the backfill needs no diagnostic, and the doc now explains what it is for instead of treating it as a guard. It also records the consequence for consumers: a backfilled started_at equals installed_at exactly, where a creation-time one is a separate event a few microseconds later, and that difference is an artifact of stamping rather than a contract anyone should read a zero queueing interval through.

Verification

Documentation only. No behaviour described here changes, and no code is touched: the corrections bring the document in line with what already shipped.


Generated by Claude Code

Two places where the merged design no longer describes main.

The per-worker log was not renamed. The columns were appended to
mz_compute_hydration_times_per_worker in place, keeping its name, OID and
object kind, so there is no compat view and `SELECT *` against it returns
a wider row. That is the better trade and the doc now argues for it: the
rename bought only the `SELECT *` width on an unstable mz_introspection
relation, while every consumer of that relation selects by name. The one
positional consumer, arrangement_sizes_snapshot, reads the aggregate
mz_compute_hydration_times, which neither approach touches. Success
criterion 7 is narrowed to match, since the log did change shape.

The started_at backfill in handle_hydration is a normal path, not a
repair for something unanticipated, and the doc's reasoning for calling
it one was wrong. Having no imports is sufficient to start immediately
but not necessary in order to hydrate early: a dataflow that does import
can still see its output frontier pass the as-of while suspended, when
the arrangement it imports is already hydrated. A handful of
mz_catalog_server indexes do that on every bootstrap. So the backfill
needs no diagnostic, and the doc says why it exists instead.

Also records the consequence for consumers, that a backfilled started_at
equals installed_at exactly where a creation-time one is a separate event
microseconds later, and that the difference is an artifact rather than a
contract worth reading a zero queueing interval through.

Ref: SQL-632

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ZVCMBSLdxzGus78ZKWhZz
@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

SQL-632

@antiguru
antiguru requested a review from aljoscha August 21, 2026 07:58
@antiguru
antiguru merged commit f9be4ed into main Aug 21, 2026
9 checks passed
@antiguru
antiguru deleted the claude/hydration-visibility-compute-js1ycm branch August 21, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants