Skip to content

controllers: freshness trees with live tick intervals - #40332

Draft
antiguru wants to merge 3 commits into
freshness/catalogfrom
freshness/trees
Draft

antiguru wants to merge 3 commits into
freshness/catalogfrom
freshness/trees

Conversation

@antiguru

@antiguru antiguru commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Builds a freshness tree per collection in both controllers, next to the existing TimeDependence, which stays byte-identical. Leaves resolve tick intervals live through StorageCollections, so ALTER SOURCE ... TIMESTAMP INTERVAL takes effect at the next observation without rebuilding dependents.

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/trees controllers: freshness trees with live tick intervals Oct 29, 2026
Comment thread src/compute-client/src/controller.rs Outdated

/// Sets the tick interval of the introspection collections.
///
/// NOTE: The logging interval is a replica setting, but the collections exist once per

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The introspection internal can be different between replicas in a cluster, and that's ok. Users should use replica-targeted queries to access the data, which makes the observation independent of other replicas. A per-replica recording of introspection freshness makes sense, but the global aggregation is not meaningful.

This is only a small wrinkle and can be documented as such, but doesn't need to be solved in code.

Comment thread src/compute-client/src/controller.rs Outdated
shared: SharedCollectionState::new(as_of),
time_dependence: Some(TimeDependence::default()),
// Until a replica with logging is added, assume the default interval.
freshness_tree: Some(logging_freshness_tree(Duration::from_secs(1))),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users the constant we use elsewhere instead of 1.

@antiguru
antiguru force-pushed the freshness/trees branch 2 times, most recently from 14cda1e to e3526a9 Compare October 29, 2026 20:20
antiguru and others added 3 commits October 31, 2026 20:51
StorageCollections keeps the tick interval of each ingestion, updates it when
an ingestion is altered, and exposes it through a live TickerLookup. Storage
collections and compute collections carry a FreshnessTree next to their time
dependence. Compute builds it with the same import walk as time dependence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R
Extract the walk of determine_freshness_tree into a pure function over
lookups and test used-import filtering, compute-over-storage precedence,
introspection leaves, and refresh schedules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LD5gyKhqBoA2DEzJk8jR1R

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