Skip to content

Stage 1 to Stage 3 silently plans a PromQL root whose series-identity rewrite fails #784

Open

Description

@zzylol

Problem, by example

For every PromQL root, Stage 1 to Stage 3 adds the series identity (with_promql_series_identity) so that each output row carries its series' labels. If the rewrite fails, the error is dropped and the root is planned unchanged:

// crates/plan-selection/src/pass/stage1_to_stage3.rs
true => with_promql_series_identity(node).unwrap_or_else(|_| Rc::clone(node)),

A root whose identity rewrite fails is then planned without per-series identity, and nothing reports it. The Planner's own executor treats the same failure as an error (promql_rows). ASAPQuery-backend's control plane used to refuse such roots too, before it switched to plan_installable. Now it can no longer see the failure.

Expected

A failed series-identity rewrite fails planning for that query with a named error. Unchanged roots are not silently accepted.

Acceptance

A test with a PromQL root whose rewrite fails returns the error from e2e_plan and from plan_installable.

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 workingpromqlPromQL front-end lowering (L1→L2)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions