fix: finalize exact state before maintained value consumers - #401
Merged
Conversation
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.
Nested maintained summaries need an explicit boundary between exact accumulator state and its values.
Before this PR, selecting
quantile(0.9, sum_over_time(m[1m]))connected KLL directly to Sum state. After this PR, the same selection contains a maintenance-timeFinalizeExactAccumulator; its output uses the inner logical schema. Existing query-time finalization remains unchanged. Shared validation admits this explicit exact-state readout without allowing arbitrary maintenance operators to consume state.Verification: 17 PromQL integration tests, 13 exact-composition integration tests, 404 mapping unit tests, 196 shared-type tests, and associated integration/doc tests pass. The real-query regression also exports the executable DAG. Existing structural pins now assert the explicit boundary.
This defines the typed boundary; backend immutable completion, grouping, window compatibility, and supported accumulator readouts remain separate execution gates. No performance claim.