Preserve Planner aggregate semantics through maintenance and serving - #700
Open
zzylol wants to merge 7 commits into
Open
Preserve Planner aggregate semantics through maintenance and serving#700zzylol wants to merge 7 commits into
zzylol wants to merge 7 commits into
Conversation
3 tasks
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.
Why
Fixes #701 and #702. Reported PromQL workloads need correct window populations, executable aggregates, and whole-expression accuracy contracts.
What
Support shared current-series quantile/TopK/sum/count/average, typed minimum, temporal average, and guarded quantile ratios. Correct both pane and full-window reads while retaining native fallback.
How
Pin Planner PR ProjectASAP/ASAPPlanner#404 at
8a943abc. Planner rules construct typed candidate DAGs; the compiler lowers their operators and compares complete physical cost quotes. Runtime enforces current-value membership, window coverage, and division domains.Before this PR
Instant aggregates could fail compilation, use temporal populations, or remain native-only. Minimum and temporal average lacked usable lowering. Sliding reads could merge overlapping snapshots or a preceding pane. Quantile division lacked a sufficient expression certificate.
After this PR
Mixed dashboards can maintain temporal summaries alongside shared current-series populations, including replacements, staleness, expiry, and maximum-k reuse. Ten quantiles share compatible state.
min_over_timeandavg_over_timeexecute from typed state; checked DDSketch division sizes operands for the requested expression bound and falls back outside its domain.Evidence
A production-HTTP workload checks 46 queries at two successive evaluations against fresh Prometheus 3.5.0, including 15m/5m windows, multiple cadences, grouped instant aggregates, and both ratio forms. Values, labels, 1% quantile/ratio tolerance, and two zero-denominator fallbacks pass. The current-series process additionally compares 20 query forms through replacements/staleness.
See the developer review. Performance measurements and screenshots: not applicable; correctness quotes are synthetic.
Verification
Regressions cover typed minimum/average/ratios, equal-valued series counts, shared current membership, invalid division domains, pre-epoch window admission, full-window pending/empty identity, and exclusion of preceding panes.
Architectural decisions
Semantic rewrites stay in Planner. Current-series state retains exact live values; it is not an append-only DDSketch. A 1% ratio requires component accuracy below approximately 0.4975%, not merely a shared 1% sketch. Deployment still requires complete cost evidence.
Limitations and follow-up
Depends on Planner PR 404. The boundary-aligned native oracle requires Prometheus 3.x semantics; 2.x includes the left boundary. Unsupported domains/coverage retain native fallback. Collector schema compatibility and measured performance benefits remain separate work.
Human review — do not complete with an agent