Skip to content

Commit

Permalink
[BUGFIX] TSDB: Don't read in-order chunks from before head MinTime
Browse files Browse the repository at this point in the history
Because we are reimplementing the `IndexReader` to fetch in-order and
out-of-order chunks together, we must reproduce the behaviour of
`Head.indexRange()`, which floors the minimum time queried at `head.MinTime()`.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
(cherry picked from commit 91de19fbeffe19429f10c501a2f4364ae01711ea)
  • Loading branch information
bboreham committed Oct 15, 2024
1 parent 35ec40c commit 520744a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,7 @@ func (db *DB) Querier(mint, maxt int64) (_ storage.Querier, err error) {

overlapsOOO := overlapsClosedInterval(mint, maxt, db.head.MinOOOTime(), db.head.MaxOOOTime())
var headQuerier storage.Querier
inoMint := mint
inoMint := max(db.head.MinTime(), mint)
if maxt >= db.head.MinTime() || overlapsOOO {
rh := NewRangeHead(db.head, mint, maxt)
var err error
Expand Down Expand Up @@ -2227,7 +2227,7 @@ func (db *DB) blockChunkQuerierForRange(mint, maxt int64) (_ []storage.ChunkQuer

overlapsOOO := overlapsClosedInterval(mint, maxt, db.head.MinOOOTime(), db.head.MaxOOOTime())
var headQuerier storage.ChunkQuerier
inoMint := mint
inoMint := max(db.head.MinTime(), mint)
if maxt >= db.head.MinTime() || overlapsOOO {
rh := NewRangeHead(db.head, mint, maxt)
headQuerier, err = db.blockChunkQuerierFunc(rh, mint, maxt)
Expand Down

0 comments on commit 520744a

Please sign in to comment.