fix(promql): bind temporal TopK update semantics on the shared workload plan - #505
Merged
Conversation
This was referenced Sep 4, 2026
This was referenced Sep 4, 2026
zzylol
changed the base branch from
main
to
feat/complete-workload-cost-selection
September 8, 2026 13:10
zzylol
changed the base branch from
feat/complete-workload-cost-selection
to
main
September 8, 2026 20:19
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
Temporal TopK must rank series by the selected producer's update semantics. A count contributes one per observation; a sum contributes the sample value. Losing this distinction, series identity, or materialization identity returns incorrect winners.
Before this PR
The branch used an obsolete Planner readout-weight API, conflicted with the workload migration, and a single-series fixture could not prove ranking correctness.
After this PR
For one window, api has four observations summing to 10, worker has two summing to 200, and cron has three summing to 30:
topk(1, sum_over_time(m[5s]))returns worker=200.topk(1, count_over_time(m[5s]))returns api=4.The next window changes the sum winner to api=26. Instant/range tests check winners, values, cardinality and timestamps. The existing backend
itemlabel contains canonical series identity; native Prometheus label reconstruction is not claimed here.Implementation and dependencies
Based on #522; merge the #513–#522 stack first. Planner #356 and #357 are merged; this branch pins revision
c3410d14865497758d212e4265ad25c782187de1.weight_modefromSummaryAgg.input.weight; reject unsupported weights.Validation
--test-threads=1. The first parallel run had five persistence failures; an isolated rerun and the serial suite passed.Self-review, not independent approval. Legacy sketch-envelope fixture failures tracked on #511 are not covered by the canonical-profile acceptance above. No merge performed.
Closes #502. Contributes the #706 rows of #501.
Planner #357 compatibility update
Synchronizes the latest #522 changes, including complete exact-fallback input-source costing, and pins merged Planner revision
c3410d14865497758d212e4265ad25c782187de1. Retains the reviewed backfill fixes: policy-aware series IDs and shared live/replay TopK update semantics. Regenerate cost manifests and quotes for the new Planner revision.Latest combined-stack validation with Planner #357: 658 control-plane library tests, 29 control-plane binary tests, one control-plane integration test, 978 data-plane library tests (serial), two compatibility process tests, and the distributed production-process test passed. An initial data-plane run exhausted the machine's root filesystem; the full rerun passed using a temporary directory on
/mydata.