Skip to content

backend-plan: construct BackendPlan from BackendStageConfig (Phase 1) - #437

Merged
zzylol merged 1 commit into
mainfrom
feat/backend-plan-from-stage-config
Jul 30, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/backend-plan-from-stage-config

Conversation

@zzylol

@zzylol zzylol commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 1 of 4 in the BackendPlan end-to-end cutover (see control_plane/docs/design-backend-plan-wire-format.md, #433). Adds control_plane::backend_plan::from_stage_config — builds a typed BackendPlan from the same BackendStageConfig input emit::stage_config::emit_backend_streaming_config_json already turns into the legacy JSON wire format.

Pure and additive: no wire/push change in this PR, nothing consumes the new function yet. Follow-ups: Phase 2 (wire push + new data_plane endpoint), Phase 3 (real call-site wiring), Phase 4 (serving-time cutover — the actual behavior change).

  • Materialization.fingerprint is derived by round-tripping through build_backend_aggregation_json (now pub(crate)) + AggregationConfig::from_yaml_data — the exact JSON shape and parser data_plane's real POST /api/v1/streaming-config handler uses — rather than a second, independently-derived field mapping. This keeps the new and legacy identity spaces bit-for-bit unified by construction.
  • RoutingEntry.satisfies (Capability) is derived from each readout's (sketch_kind, op) pair, or Capability::ExactAgg for agg_type_override rows.

Test plan

  • cargo test --release -p control_plane --lib backend_plan:: — 14/14 pass, including a fingerprint-parity test that independently hand-builds the expected AggregationConfig (not via the JSON round-trip) and asserts equal fingerprints.
  • cargo build --release --workspace — clean.

Phase 1 of the BackendPlan end-to-end wiring (control_plane emit ->
data_plane serving). Pure, additive: a new from_stage_config() function
builds a typed BackendPlan from the same BackendStageConfig input
emit_backend_streaming_config_json already turns into the legacy JSON
wire format. No wire/push change yet -- that's Phase 2/3.

Fingerprint parity with the legacy StreamingConfig path is the critical
invariant: Materialization.fingerprint is derived by round-tripping
through build_backend_aggregation_json + AggregationConfig::from_yaml_data
(the exact JSON shape and parser data_plane's real
POST /api/v1/streaming-config handler uses), not a re-derived field
mapping, so the two identity spaces can never drift apart.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant