Skip to content

refactor: unify VictoriaMetrics parser contract - #600

Merged
zzylol merged 6 commits into
mainfrom
refactor/vm-parser-contract
Sep 10, 2026
Merged

zzylol merged 6 commits into
mainfrom
refactor/vm-parser-contract

Conversation

@zzylol

@zzylol zzylol commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

VictoriaMetrics planning used a separate MetricsQL frontend while backend parsing was split across parser sources. That allowed parser behavior and supported syntax to drift across one planning contract.

What

Remove backend asap-frontend-metricsql, route VictoriaMetrics acceleration through the shared ASAP PromQL frontend, and pin every Planner crate to merged Planner commit 890504025e4f780880cc6c89d24edd6591af868a. Preserve QueryLanguage::MetricsQl and VictoriaMetrics exact endpoints.

How

Merged backend #603 owns the sole direct workspace parser declaration at ProjectASAP/promql-parser d7606436; control plane and data plane inherit it. The stale standalone control-plane lockfile is removed so the root workspace lock is authoritative. Adapter identity follows parser syntax, while the binder requires successful frontend lowering before a query can accelerate.

Before this PR

MetricsQL-specific parsing could create accelerated plans through a separate AST and dependency graph.

After this PR

The full stack resolves one v0.10 parser source at d7606436. mad_over_time has explicit lowering and can accelerate. distinct_over_time and entropy_over_time parse but fail closed in the lowerer/binder and use exact VictoriaMetrics fallback. default_rollup and topk_over_time fail at the parser boundary and also use exact fallback.

Verification

  • cargo +1.98.0 check -p data_plane --lib
  • VictoriaMetrics adapter boundary tests: 3 passed.
  • VictoriaMetrics binder tests: 7 passed.
  • Planner feat(gos): split Discipline B — retire alerting, decouple sample_p from countdown #385 boundary test proves newly parsed reducers remain exact-only.
  • cargo +1.98.0 tree -d and repository-wide manifest/lock inspection confirm one promql-parser source/revision and no asap-frontend-metricsql or metricsql_parser dependency.
  • cargo +1.98.0 fmt -p control_plane -p data_plane -- --check
  • git diff --check

Dependencies and limitations

Rebased onto backend main after #603 and pinned to the merge commit from Planner #385. Candidate-filtered MetricsQL exact leaves remain fail closed because matcher injection is defined only over the shared PromQL AST. Lowering distinct_over_time to HLL is intentionally outside this PR.

@zzylol
zzylol force-pushed the refactor/query-engine-runtime-contract branch from 3dd9c90 to 33cea43 Compare September 10, 2026 21:09
@zzylol
zzylol force-pushed the refactor/vm-parser-contract branch 2 times, most recently from ec4c760 to 08bbbe0 Compare September 10, 2026 21:32
@zzylol
zzylol changed the base branch from refactor/query-engine-runtime-contract to chore/pin-promql-parser-d7606436 September 10, 2026 21:32
@zzylol
zzylol force-pushed the chore/pin-promql-parser-d7606436 branch from 06e4aae to e14930b Compare September 10, 2026 21:33
@zzylol
zzylol changed the base branch from chore/pin-promql-parser-d7606436 to main September 10, 2026 21:33
@zzylol
zzylol changed the base branch from main to chore/pin-promql-parser-d7606436 September 10, 2026 21:33
@zzylol
zzylol force-pushed the refactor/vm-parser-contract branch from 08bbbe0 to daf33da Compare September 10, 2026 21:34
@zzylol
zzylol changed the base branch from chore/pin-promql-parser-d7606436 to main September 10, 2026 21:51
@zzylol
zzylol force-pushed the refactor/vm-parser-contract branch from daf33da to ccb4024 Compare September 10, 2026 21:51
@zzylol
zzylol merged commit 732b394 into main Sep 10, 2026
1 check passed
@zzylol
zzylol deleted the refactor/vm-parser-contract branch September 21, 2026 18:43
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