Skip to content

schema-retirement #5: retire query-path aggregation_id, route directly through sid catalog #272

Description

@zzylol

Tracking issue for the final step of the agg_id retirement migration. Steps #1-#4 already landed (sid-level eviction, sid-level reconcile from streaming-config, sid-level §6.3 ingest barrier, big-bang SchemaRegistry deletion — see PRs #183-#187 + #189). Step #5 is the remaining surface: the query path still resolves precomputed outputs via StreamingConfig.aggregation_id, and ingest still buckets per-(aggregation_id, group_key) even though storage downstream is sid-keyed.

This is the issue that #271 (MVP demo: agent emits full-attr sketches → no sid match) calls out as one of two fix paths for Axis C of the MVP smoke test.

Concrete sites still holding agg_id

data_plane/src/query_engines/asap_query_engine/engine.rs
  :2392   "Until schema-retirement #5 ports the per-segment dispatch
           to sid-level evaluation directly …"
  :945, :990, :969, :1042, :1127, :2066, :2099, :2197, :2305
          full per-segment dispatch + error paths still keyed on agg_id

data_plane/src/drivers/ingest/otel.rs
  :561    by_group.entry((config.aggregation_id(), group_key))
  :640    WorkerMessage::AccumulatorInput { agg_id: config.aggregation_id(), … }
  :1203   // DEPRECATED: aggregation_id-keyed write — remove
  :520, :723   "Schema retirement #5 — agg_id-keyed `SchemaRegistry` is gone"
          (already done; reference comments)

data_plane/src/precompute_engine/output_sink.rs
  :206, :232   output sink still tags writes with cfg.aggregation_id()

data_plane/src/storage_engines/sketch_db/backfill/processor.rs
  :343, :350, :418, :440, :596, :646   backfill processor maps still keyed on agg_id

data_plane/src/storage_engines/types/precomputed_output.rs
  :40, :162   `// with aggregation_id kept for legacy compat; PR 5 retired …`

data_plane/src/main.rs
  :491, :562, :739, :784   `// Schema retirement #5 — …` reference comments

What "done" looks like

  1. Query path's build_query_execution_context_promql_for_agg_id (engine.rs:2197) folded into a sid-keyed equivalent that takes (metric, agg_kind, attrs_subset) and finds candidate sids whose group_by_keys ⊇ attrs_subset, then merges across them.
  2. Ingest bucketing in otel.rs:561 rekeyed from (aggregation_id, group_key)(sid, …) or (metric, agg_kind, group_key) → sids.
  3. output_sink.rs and backfill/processor.rs rekeyed from agg_id → sid.
  4. PolicyFingerprint::as_u64() survives as the streaming-config identity for the OUTSIDE world (controller → backend POST, persistence), but the internal config.aggregation_id() accessor disappears from hot paths.
  5. Re-enable the two ignored cross-reconfigure dispatch tests in tests/schema_timeline_dispatch_tests.rs (gated by sid-level per-segment dispatch — fixture needs reworking too because the two test configs collapse to one sid under content-addressing; see asapquery-backend-phase5-m2-3-progress notes).
  6. Delete pub fn aggregation_id() on AggregationConfig (or downgrade to test-only) once all consumers are gone.

Why this unblocks the MVP demo

With schema-retirement #5 done, the query path resolves directly from the metric name + asked grouping to a set of sids in the catalog — no PolicyFingerprint detour. The full-attr sketches the agent currently emits (because of ASAPCollector#381 — agent doesn't apply OpAMP runtime config) become queryable: their group_by_keys is a superset of [zone], so a sum by (zone) query merges across them at execution time.

(Until #5 lands, the alternate unblock is to have the agent group-reduce upstream of the sketch — needs ASAPCollector#381 first.)

Done already (don't redo)

See asapquery-backend-phase5-m2-3-progress memory + the post-M2.3 sketch_db reorg notes for the broader context.

Tagged mvp-demo, query-engine, schema-retirement-5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions