Repository navigation
Conversation
…and asap-executor only Re-pin ASAPPlanner to main f0dc1825 and use its handoff API. - The control plane calls `asap_planner::plan_installable` once and writes the returned `InstallablePlan` as plan.json. The backend's own pane-chain expansion, Stage 2/3 plumbing and query-time reference rebuild are gone; tests use `InstallablePlan::query_time_reference`. - The data plane reads `stored_outputs` (built_at, pane window, retention_ms) and `query_time_raw_windows`, and selects every pane's and raw window's rows with `asap_executor::RawSampleSelector`. It no longer uses `frontier_from_timing` or `promql_rows`. - The SDS keeps its own identity (sub-DAG hash, offset-only TimeShifts transparent) and keeps each definition for the largest `retention_ms` among its outputs, measured from the newest evaluation that can read it, instead of "largest offset plus two pane widths". - Among Planner crates the workspace depends on `asap-planner` and `asap-executor` only; IR types come through `asap_executor::planner`. - `--plan-selection-settings` on the control plane and `--execution-memory-limit-mib` on the data plane, which the benefit harness passes.
This was referenced Oct 19, 2026
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 1/4 of the runtime work on top of #825. Base: #825.
Why
ASAPPlanner main now has the deployment handoff: one
plan_installablecall returns anInstallablePlan, which lists the outputs to store (withbuilt_at, pane window andretention_ms) and the raw windows read at query time. Samples go throughasap_executor::RawSampleSelector. Until now the backend rebuilt all of this itself. It expanded pane chains, searched the timing frontier, encoded PromQL rows, rebuilt the query-time reference and kept panes by its own "largest offset + 2 widths" rule. The design doc's boundary says the Planner decides what to compute and the backend decides how.What
f0dc1825. Among Planner crates the workspace depends only onasap-plannerandasap-executor. IR types are reached throughasap_executor::planner. The sync script and its test now update two dependencies.plan_workloadcallsasap_planner::plan_installableand returns itsInstallablePlan, whichsave_planwrites as plan.json. Non-PromQL workloads are refused by the Planner's own frontend check. New--plan-selection-settings <json>(cost model, prices, speed, measured costs).stored_outputs.IngestionRunoutputs are built at ingestion andQueryRunoutputs are kept across evaluations; panes and offsets come from each output'spane.TimeShifts transparent).retention_msamong its outputs. A pane is evicted once it starts beforenewest evaluation − retention. For stored panes, the newest evaluation is taken as the newest closed pane.RawSampleSelector(Scan matchers, instant-selector latest sample).query_time_raw_windows.series_labels_of_output_row.--execution-memory-limit-mib(the benefit harness passes it).plan_selected_at_query_time),frontier_from_timing,promql_rows, and the SDS's own shape walk. Shape errors are now the Planner's (InstallablePlanError).How
Sds::from_planfoldsstored_outputsinto definitions by identity, taking the max retention.PaneBuildcompiles a definition's builder from itsTimeRangeand feeds itRawSampleSelector::rows(end, samples).QueryEnginecompiles eachInstalledQuery.root_node_id, cut at stored outputs, kept outputs andquery_time_raw_windows. Tests compare againstInstallablePlan::query_time_reference().Before this PR
plan.jsonwas the backend's ownInstalledPlan {queries, dag}. The data plane derived stored outputs withfrontier_from_timing, kept panes formax offset + 2 × width, and built rows withpromql_rows::series_row. A range query over panes older than the newest instant evaluation was answered from that slack.After this PR
plan.jsonis the Planner'sInstallablePlan, and the backend reads what to store and for how long from it. Example 4b without raw data: one definition of six 10-minute KLL panes, kept 60 min. A range evaluation the workload declares (range_evaluation) extends the retention. A range query reaching further back than the workload declares now reads an evicted pane and is forwarded with the reason.Verification
cargo test --workspacepasses, includinge2e_examples(9),range,kept,answers,sds,precompute.precompute::keeps_panes_for_the_plans_retentionfailed on feat(query): answer planned range queries one evaluation per step #825's head (the 30-min pane was still stored under "offset + 2 widths"). The updated expectations inkept.rsandrange.rsencode the plan's 5-minute retention and also fail on feat(query): answer planned range queries one evaluation per step #825.answers.rs,range.rs,e2e_examples::example4b_range) now declare their range evaluation in the workload.Benefit harness (release, Prometheus 3.5.0)
Setup:
benchonexp/benefit-harnessas a tool (unchanged), examples workload, 90 min of data, one sample per series every 15 s. Prices: AWS Fargate us-east-1 (cost model 1); measured operation costs as before. Prometheus is pinned to 4 cores and the data plane to another 4. s10 = 2,000 series, s50 = 10,000. CPU is core-seconds over the whole run. Latency is per query, p50 / p99 ms.P141-m8with raw data,P195-m40without).sum by (job) (rate(http_requests_total[1m])), topk =topk by (job) (10, sum_over_time(http_requests_total[1m])), p99[5m] / p99[60m] =quantile_over_time(0.99, latency_ms[5m|60m]).s10
s10-noraw
s50
s50-noraw
Forwarded evaluations without raw data (5 → 325). The harness evaluates
example1every 10 s right after writing samples up to 5 s later. By then the newest closed pane is past the evaluation time. Measured from that pane, the plan's 60-second retention for the 10-s panes evicts the oldest pane the evaluation reads. One evaluation in three of eachexample1query is forwarded ("pane … is not stored"). The old rule's extra pane width hid this. Where "newest evaluation time" sits for ingestion-built panes is an open design question, reported separately; it is not settled in this PR.Planner gaps found
RawSampleSelector::rowstakes ownedSamples with an owned labelBTreeMap, so every buffered or fetched sample is copied into a new map before selection. Smallest fix: accept&[impl Borrow<Sample>]orArclabels.asap_plannerdoes not re-exportQueryLanguage, so a runtime cannot name the workload language without depending onasap-types.plan_installableisasyncfor the SQL frontend only; a PromQL runtime blocks on it.