Conversation
milindsrivastava1997
marked this pull request as ready for review
September 13, 2026 23:42
milindsrivastava1997
force-pushed
the
706-lookback-vs-promql-range-selector-redundant-window-concepts-+-query_range-readout-bug
branch
from
September 13, 2026 23:45
090b81f to
fe21bce
Compare
milindsrivastava1997
marked this pull request as draft
September 13, 2026 23:46
milindsrivastava1997
marked this pull request as ready for review
September 13, 2026 23:46
zzylol
approved these changes
Sep 14, 2026
zzylol
deleted the
706-lookback-vs-promql-range-selector-redundant-window-concepts-+-query_range-readout-bug
branch
September 14, 2026 20:34
zzylol
restored the
706-lookback-vs-promql-range-selector-redundant-window-concepts-+-query_range-readout-bug
branch
September 14, 2026 20:34
zzylol
deleted the
706-lookback-vs-promql-range-selector-redundant-window-concepts-+-query_range-readout-bug
branch
September 14, 2026 20:34
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
A snapshot's manual
time_selection.lookbackcan disagree with PromQL, causing planning and readout to use the wrong history (#706).Changes
Derive each query's history from its PromQL tree, including range selectors, subqueries, positive offsets, and every branch of joins, binary operations, and concatenations. Apply required
implementation.scrape_interval_msto each rangeless source before adding enclosing history. Explicit range selectors retain their own materialization windows.Reject non-null manual snapshot lookback and fractional-second ranges/offsets that the seconds-based backend cannot represent. Migrate discovery output to the new schema and observed scrape cadence, preserve snapshot roundtrips, and add compiler and discovery-to-planner regressions. Resolve conflicts with main while preserving the Min/Max split and current-series execution.
The scrape-cadence default is the backend-local planning contract. It is distinct from Prometheus's instant-selector lookback delta. Current-series execution retains its independent five-minute selector lookback and receives the declared scrape cadence for its input-lag limit. The measured window cost model is preserved; HTTP query_range behavior remains tracked separately in #720.
Before this PR
A 5-minute selector could be planned with a conflicting 1-minute manual lookback. Rangeless queries had no automatic cadence default.
After this PR
A 5-minute selector derives 300 seconds automatically. With a 5-second scrape cadence,
sum(a offset 1h)derives 3605 seconds, and a mixed expression containing a 1-second range and a rangeless source retains a 5-second horizon. Histogram concatenations preserve their range requirements. Discovery-generated snapshots deserialize and plan without supplying manual lookback.Verification
cargo clippy --workspace --all-targets -- -D warningspassed.sum/count/avg byandavg_over_timeare not accelerated; instantsumfails to compile #702, TopK, and repeated dashboards.MVP backendCI is running onf7a334ba; formatting and workspace check have passed.