Repository navigation
Conversation
This was referenced Oct 7, 2026
…ecution stack The backend now executes ASAPPlanner's selected PhysicalASAPDAG as given (#509): the Planner runs Stages 0-3, the backend supplies deployment inputs. - Pin every Planner crate the backend uses to ASAPPlanner main (58999df2): asap-types, asap-frontend-promql, asap-logical-asap-optimization, asap-plan-selection, asap-executor. The sync script updates all five. - control_plane: lower a PromQL PlanningWorkload, run Stages 1-3 (run_stage1_to_stage3) under DeploymentInputs (DeploymentCapabilities and PlanSelectionSettings), and write the selected candidate's DAG, with each PaneChain expanded into its panes, plus the query each root answers (plan.json). - data_plane: load and validate plan.json, accept Remote Write, forward queries to Prometheus until the query engine lands. - Remove the backend's own plan selection, placement pricing, ERP, SDS, precompute and query engines, ClickHouse, OTel and OpAMP paths, which were built on the removed Planner APIs.
zzylol
force-pushed
the
feat/physical-dag-handoff
branch
from
October 18, 2026 15:40
77f23de to
440851b
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 1/5 for executing the plan ASAPPlanner selects (#509's physical ASAP DAG). Next: #819.
Why
The backend selected its own plans, with its own ERP, SDS, precompute and query engines, and each part pinned a different Planner revision, so none of it ran the plan the Planner selects. The Planner now selects plans end to end on its
main; the backend should only supply deployment inputs and execute the result.What
PlanningWorkloadwith the Planner's Stages 0–3 under the backend's deployment inputs and writesplan.json(InstalledPlan): the selectedPhysicalASAPDAGplus the query each root answers.main58999df2 for all five crates the backend uses:asap-types(asplanner-types),asap-frontend-promql,asap-logical-asap-optimization,asap-plan-selection,asap-executor.scripts/sync-asapplanner-main.shand its test now update five pins.examples/planner-layering-example1.json, test(promql): enforce range step parity in production E2E #509 Example 1 in the current workload format (DataWorkload { arrival, sources },AccuracyTarget,QueryRequirements { accuracy, max_latency_ms }), generated from the Planner's own example definitions.crates/,docs/,demos/,tools/and the Python package. The table in Deleted capabilities lists each piece and its replacement; the ones not replaced yet are tracked in Capabilities removed with the old backend that are not replaced yet (#818) #823.Supersedes #788–#812, #791 and #779.
Deleted capabilities
Every piece of the old backend this PR deletes, and what replaces it. "Deferred" rows have no replacement yet and are tracked in #823.
control_plane/src/planner_selection.rs,workload_cost.rs,physical/cost_model.rs,physical/tco.rsselect_plan, cost models 1–3)control_plane/src/physical/erp.rs,tools/empirical-benchmeasured_operation_costs, imported from sketch-benchcontrol_plane/src/accuracy.rs,epsilon_alloc.rsAccuracyModelcontrol_plane/src/physical/materialization_candidates.rs,pane_reuse.rs,maintained_population.rscontrol_plane/src/physical/sketch_catalog.rs,summary_catalog.rs,runtime_capability.rs,control_plane/sketch_capabilities.yml,sketch_params_default.ymlDeploymentCapabilitiescontrol_plane/src/query_parser,physical/compiler.rs,lower.rs,matcher.rs,deployment_expr.rs,realization.rs,executable_binding.rs,query_plan.rs,query_plan/query_time.rsplan.jsoncontrol_plane/src/physical/wire.rs,emit/backend_wire.rs,backend_client.rs,publication.rs,plan_dot.rs,status.rs,types.rs,workload.rs,control_plane/protoplan.json(InstalledPlan), loaded by the data planecontrol_plane/src/clickhouse.rs,query_plan/clickhouse_exact.rscontrol_plane/src/opamp,emit/monitor.rs,physical/online.rs,runtime_samples.rs,metrics_exposer.rscrates/asap_typesasap-types, pinnedcrates/asap_otel_proto,data_plane/src/drivers/ingest/otel.rsdata_plane/src/drivers/ingest/prometheus_remote_write.rs,series_resolver.rsScan(#820)data_plane/src/drivers/query/adapters/prometheus_http.rs,query/fallback/prometheus.rs,query/serversdata_plane/src/drivers/query/adapters/victoriametrics_http.rs,query/fallback/victoriametrics.rsdata_plane/src/precompute_engine(window manager, ingest handler, maintenance runtime, output sink, raw DAG, group keys, metrics)data_plane/src/precompute_engine/revisions.rs,frame_lineage.rsdata_plane/src/precompute_engine/partitioning.rs,series_router.rs,subdag_scheduler.rs,worker.rsdata_plane/src/precompute_engine/erp_observer.rsdata_plane/src/query_engines/asap_query_enginedata_plane/src/query_engines/routing(capability matching, freshness probe, storage routing)data_plane/src/query_engines/asap_clickhouse_query_enginedata_plane/src/storage_engines/sketch_db/sds.rs,index,lifecycle,current_series.rs,data,querySummaryStore(#819)data_plane/src/storage_engines/sketch_db/persistencedata_plane/src/storage_engines/sketch_db/backfilldata_plane/src/storage_engines/sketch_db/accuracy.rs,metrics.rsdata_plane/src/update_samplingdata_plane/src/bin,benches,examples,tests(old)data_planebinary and tests (#819–#822)control_plane/Dockerfile,data_plane/Dockerfile,data_plane/*.yml.j2,demos/asapquerytools/autosketch-comparison,tools/erp-figure1tools/o11y-execution,tools/shared-workload,tools/run-offline-planner-replay.py,tools/test_shared_panes.pytools/clickhouse-benefit,tools/o11y-sql-main-evaltools/cluster-data-exporterdocs/(getting started, guides, design, developer, evaluation, user guide)pyproject.tomland the Python packageHow
plan_workloadlowers the workload withasap_frontend_promql::lower_promql_query_workload, adds each series' identity to PromQL roots (as the Planner'sStage1ToStage3Passdoes), and runsasap_plan_selection::run_stage1_to_stage3withPlanningModels::builtin()plus the backend'sDeploymentCapabilitiesandPlanSelectionSettings. The backend never chooses: it takes Stage 3'sSelection::plan(the selected candidate's timed roots), expands eachPaneChaininto its panes withexpand_pane_chains(the executor's compiler rejects unexpanded chains), and exports it withcompile_physical_asap_workload.run_stage1_to_stage3is used instead of theasap-plannerfacade'se2e_planbecausee2e_planreturnsPlanOutput, whose DAG export resets every node to query time, and because the facade pulls in the SQL frontend (DataFusion), which a PromQL-only backend does not need.The backend declares
query_time_results_retained: false: the data plane does not implementMatAtQueryKeptAcrossEvaluations, so the Planner never offers it.Key code interfaces added / modified
control_planeCLI:--workload,--deployment-capabilities(PlannerDeploymentCapabilitiesJSON),--measured-operation-costs(PlannerMeasuredOperationCostlist JSON),--out.Before this PR
The backend selected its own plan with its own cost model and engines, on Planner revisions that differed per crate.
After this PR
The plan is the one the Planner selected (for Example 1,
P1: both queries exact at query time). The data plane installs it and forwards queries withx-asap-execution: forwarded.Usage
Verification
cargo test -p control_plane -p data_plane(control plane 3 tests: plans Example 1 and round-tripsplan.json, rejects SQL, rejects a plan without a query per root; data plane: Remote Write decoding and forwarding).cargo fmt --all -- --check;cargo clippy --workspace --all-targets -- -D warnings;python3 -m unittest discover -s scripts/ci -p 'test_*.py'.x-asap-execution: forwardedwith the upstream's status passed through, checked against a stand-in HTTP server.