refactor: share installed QueryPlan contracts across components - #634
Merged
Merged
Conversation
…-plan-contract # Conflicts: # control_plane/src/query_plan.rs # crates/asap_types/Cargo.toml # data_plane/tests/clickhouse_differential_e2e.rs
zzylol
marked this pull request as ready for review
September 11, 2026 14:56
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.
Installed QueryPlan definitions lived beside control-plane compilation, so data-plane serving imported its runtime contract from the compiler component. This separates ownership without adding a wrapper or a second wire representation.
asap_types::query_plannow owns QueryPlan, materialization bindings, residual operator types, topology checks and activation validation. Planner traversal, binding and AST lowering remain in the control plane ascompile_bound*andlogical::compile_logicalfunctions. Data-plane engines import the shared types directly; the control plane reexports them for existing type paths. An unused whole-native-root promotion helper is removed.Before this PR: shared installed data and compiler methods were defined on the same control-plane types.
After this PR: components exchange one shared contract while the control plane remains responsible for constructing it. Serialization, node identities, Catalog references and execution semantics are unchanged. The SDS architecture document records this ownership split.
Verification: 81 shared-type tests, all 763 control-plane tests and 1,095 data-plane unit tests passed; three existing unrelated doctests remain ignored. A Send/Sync assertion protects installed plans from acquiring Planner process-local Rc state. Independent ownership review passed. These suites preceded the latest clean replay of #617/main; CI for that replay is running. No performance claim; collector/transmission contract migration remains separate.
Stacked on #617. Callers of former
QueryPlanEntry::compile_*methods now use the control-plane free functions; all in-repository callers are migrated.