Skip to content

compute: record freshness histograms - #40333

Draft
antiguru wants to merge 6 commits into
freshness/treesfrom
freshness/compute-recording
Draft

antiguru wants to merge 6 commits into
freshness/treesfrom
freshness/compute-recording

Conversation

@antiguru

@antiguru antiguru commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Records the arrival-weighted latency histogram for compute collections, globally and per replica, at every write frontier advance. Introspection log collections are recorded per replica only, since each logs one replica and a global histogram would mix unrelated frontiers. Their recording ends with the replica and starts fresh after a rehydration. Moves the instance tests to their own file first, and puts the recording module in mz-storage-client, where the storage controller uses it next.

Part of P-CPU-328, design in #40320. Recording and reporting are behind enable_wallclock_freshness_recording and enable_wallclock_freshness_reporting, both off in production, so this changes nothing users see.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R

@antiguru
antiguru added this pull request to stack #40339 October 29, 2026 06:37
@antiguru antiguru changed the title freshness/compute recording compute: record freshness histograms Oct 29, 2026
@antiguru
antiguru force-pushed the freshness/compute-recording branch from 68ed429 to 5c0125f Compare October 29, 2026 07:46
@antiguru
antiguru force-pushed the freshness/compute-recording branch from 5c0125f to c3050e5 Compare October 29, 2026 11:51
@antiguru
antiguru force-pushed the freshness/compute-recording branch from c3050e5 to 6bcc505 Compare October 29, 2026 20:20
@antiguru
antiguru force-pushed the freshness/compute-recording branch from 6bcc505 to 15b7b94 Compare October 30, 2026 09:24
@antiguru
antiguru force-pushed the freshness/compute-recording branch from 15b7b94 to f9ec3fb Compare October 30, 2026 09:51
@antiguru
antiguru force-pushed the freshness/compute-recording branch 2 times, most recently from b927895 to bb491e7 Compare November 2, 2026 04:09
antiguru and others added 6 commits November 2, 2026 18:03
Pure move of the inline test module of the compute instance controller to
instance/tests.rs, ahead of adding instance-level tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
The compute instance keeps one freshness recorder per collection, driven by
advances of the global write frontier, and one per replica collection, driven
by Frontiers responses. Rows go to the global and per-replica freshness
histograms with measure end_to_end and the workload-class labels of the
existing lag histogram.

Collections installed after initialization start recording at their creation,
so hydration counts as latency. Collections installed during bootstrap, and all
collections after recording is switched on, start at their first observed
frontier. A rehydrated replica keeps its recorders, so its regressed frontier
does not count arrivals twice. Dropped collections discard their open periods.
Recording is off in read-only mode and without the recording flag, and
switching the flag off drops all recorder state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
A recording created with an as-of that reflects nothing, as `[0]` for a
collection over a snapshotting source, started at its first observed
frontier. A first frontier near the epoch charged the decades since as
latency, and the catch-up overloaded environmentd.

A collection created after initialization now starts at the latest of
what its as-of reflects, its creation time, and the retention before
the first observation. A recording that starts at its first observation
is floored by the wall-clock time at which it was built, so it leaves a
hole instead. The recorder configuration reads the histogram retention.

Dropping a collection or removing a replica finishes the recordings and
writes their open periods, which were discarded before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
The storage controller records freshness histograms with the same code in
the next change, so the module starts out in storage-client, which both
controllers depend on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
A log collection logs one replica, so its contents differ between
replicas, and a global histogram of it mixes unrelated frontiers. Its
global recording is gone, and its per-replica recordings run from the
replica's creation until the replica goes away, which emits their open
periods.

Rehydration keeps per-replica recordings so a replica that reports from
its as-of again does not count arrivals twice. A rehydrated replica's
logs start over, though, so for log collections rehydration ends the old
recording and the new one starts at the replica's creation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
Finishing a recording records the arrivals that the period book deferred,
which needs the collection's tree, the wall-clock time and the recorder
configuration. The compute controller resolves the tree when a collection
or replica goes away and passes all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
@antiguru
antiguru force-pushed the freshness/compute-recording branch from bb491e7 to 0692319 Compare November 2, 2026 17:17

This branch has not been deployed

No deployments
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.

1 participant