Browse Source

Fix issue where pending OOO read can be left dangling if creating querier fails

Signed-off-by: Charles Korn <charles.korn@grafana.com>
pull/14341/head
Charles Korn 5 months ago
parent
commit
2c5e88748e
No known key found for this signature in database
  1. 3
      tsdb/db.go

3
tsdb/db.go

@ -2077,6 +2077,9 @@ func (db *DB) blockChunkQuerierForRange(mint, maxt int64) (_ []storage.ChunkQuer
rh := NewOOORangeHead(db.head, mint, maxt, db.lastGarbageCollectedMmapRef)
outOfOrderHeadQuerier, err := NewBlockChunkQuerier(rh, mint, maxt)
if err != nil {
// If NewBlockQuerier() failed, make sure to clean up the pending read created by NewOOORangeHead.
rh.isoState.Close()
return nil, fmt.Errorf("open block chunk querier for ooo head %s: %w", rh, err)
}

Loading…
Cancel
Save