Skip to content

fix(metricsql): keep counter rollups on the native exact engine - #636

Merged
zzylol merged 6 commits into
mainfrom
fix/metricsql-counter-semantics
Sep 11, 2026
Merged

zzylol merged 6 commits into
mainfrom
fix/metricsql-counter-semantics

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Native MetricsQL counter rollups use different boundary semantics from the backend’s Prometheus counter readout. A real reset fixture returned warm ASAP rate=5 and increase=25, while VictoriaMetrics v1.126.0 returned 6 and 30 for the same samples, labels, timestamp, and five-second window.

The MetricsQL compiler now excludes Rate/Increase state bindings and preserves their external exact dependencies. The runtime also rejects these local readouts in previously installed MetricsQL plans. PromQL compilation retains its existing counter materialization behavior. This is a correctness gate until native MetricsQL counter semantics have an implementation; it does not add acceleration.

Before this change, a selected counter state could return a successful but incorrect warm result. After it, the affected MetricsQL branch executes through the native exact engine.

Verification: two compiler tests passed, including an independently materialized max sibling alongside the exact counter branch. The runtime test passed with explicit counter fallback reasons and unchanged PromQL reset behavior. The pre-fix real process differential recorded both mismatches and correct external exact alternatives. Post-fix process replay and CI are pending. Stacked on #626.

@zzylol
zzylol changed the base branch from feat/metricsql-calibration-workflow to main September 11, 2026 16:48
@zzylol
zzylol marked this pull request as ready for review September 11, 2026 16:51
@zzylol
zzylol merged commit c744805 into main Sep 11, 2026
1 check passed
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