Persist executable DAG bindings in installed plans - #579
Merged
Merged
Conversation
zzylol
force-pushed
the
refactor/persist-post-asap-dag
branch
3 times, most recently
from
September 10, 2026 16:41
fa050c8 to
affc4ba
Compare
zzylol
force-pushed
the
refactor/persist-post-asap-dag
branch
from
September 10, 2026 16:48
affc4ba to
6832db8
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.
Why
The compiler translated Planner post-ASAP DAGs into query and precompute projections, then discarded the typed semantic DAG and backend placement map. The installed plan therefore could not schedule maintenance subDAGs or prove which Planner node produced each materialization/query node. Hybrid exact work was also encoded as a PromQL-specific logical side channel instead of a normal query DAG dependency.
Before
PrecomputePlanretained materializations but not the Planner DAG or backend node placement.LogicalOperator::CandidateExactSubquery, coupling the shared QueryPlan DAG to PromQL preparation.After
PostAsapDagDocumentplusBackendExecutableBindingfor every compiled query inPrecomputePlanand therefore in the immutableActivePhysicalPlansnapshot.PostAsapNodeId,SummaryDefinitionId, andQueryNodeIddomains, including explicit maintenance/query placement and sink references.QueryPlanNode::ExternalExactwith an explicit output shape and input contracts. Hybrid Candidate TopK now consumes candidate membership and external exact values through ordinary DAG edges.Example
For hybrid
topk(2, sum by(job)(rate(m[1m]))), the installed query DAG is:CMS membership readout -> ExternalExact(candidate_membership=job) -> CandidateTopKThe exact engine receives only the selected membership set and returns an instant vector;
CandidateTopKcombines both dependency results normally.Verification
cargo check --workspace --all-targetscargo test -p control_plane --lib physical::compiler::tests(67 passed)cargo test -p control_plane --lib query_plan::tests(5 passed)cargo test -p data_plane --lib precompute_engine::subdag_scheduler::testsDependency and migration surface
Depends on #576. Runtime scheduler work should consume
PrecomputePlan.executable_dags; external engines implementExternalExactRequestand return the declaredExternalExactOutput. ClickHouse integration should map its exact leaf to this shared node and must not add a parallel plan catalog or executable-plan envelope.