fix(metricsql): keep counter rollups on the native exact engine - #636
Merged
Merged
Conversation
zzylol
changed the base branch from
feat/metricsql-calibration-workflow
to
main
September 11, 2026 16:48
zzylol
marked this pull request as ready for review
September 11, 2026 16:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native MetricsQL counter rollups use different boundary semantics from the backend’s Prometheus counter readout. A real reset fixture returned warm ASAP
rate=5andincrease=25, while VictoriaMetrics v1.126.0 returned6and30for 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.