Repository navigation
Conversation
This was referenced Oct 7, 2026
An engine thread owns the installed plan (Planner IR holds Rcs) and receives Remote Write samples from the HTTP server. For each stored summary definition it buffers its Scan metric's samples by tumbling pane (end - width, end], like PromQL ranges. When the watermark (newest sample minus --allowed-lateness-ms) passes a pane's end, it runs the plan's Scan over them (applying label matchers) and the definition's build from its TimeRange input, then stores the output. Panes without samples are stored empty; the first pane seen is skipped because it may be partial; samples for built panes are dropped and counted. A full engine queue answers Remote Write with 503 so senders retry.
zzylol
force-pushed
the
feat/precompute-engine
branch
from
October 18, 2026 15:40
eb8a314 to
f9c3343
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 3/5. Base: #819. Next: #821.
Why
Remote Write samples were accepted and dropped, so no stored summary was ever built.
What
A precompute engine on the engine thread builds stored panes from Remote Write:
Scanselects them, so its label matchers apply.(end − width, end](left-open, like PromQL ranges and the executor's windows) is built once the watermark (newest sample − allowed lateness) passesend. The build runs the definition's builder, compiled from the DAG withasap_executor::physical_planner::compile, under ingestion scope, and stores the summary batch. Panes without samples are stored empty./api/v1/writereturns 503 when the engine queue is full, so senders retry.data_plane --allowed-lateness-ms(default 15 s).How
The Planner IR holds
Rcs, so one engine thread owns the plan, the precompute engine and the store; HTTP handlers send it commands over a bounded channel.Key code interfaces added / modified
DataPlane::new(plan_json, prometheus_url, allowed_lateness_ms)now starts the engine.Before this PR
Remote Write samples were decoded and dropped.
After this PR
Example 4b without raw data, one series sampled every 15 s from 1 to 75 min: the pane ending at 10 min is skipped as possibly partial, and panes ending at 20..70 min are built.
Usage
Verification
data_plane/tests/precompute.rs(5 tests): the watermark and skipped first pane, ignored metrics and dropped late samples, empty panes, label matching, left-open boundaries.cargo test -p control_plane -p data_plane, fmt, clippy on this PR's tree.