Skip to content

Commit 60bc270

Browse files
authored
Ignore series API lookups to chunks store (#3559)
Signed-off-by: Goutham Veeramachaneni <[email protected]>
1 parent 1ba26bc commit 60bc270

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/querier/chunk_store_queryable.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ func (q *chunkStoreQuerier) Select(_ bool, sp *storage.SelectHints, matchers ...
4343
if err != nil {
4444
return storage.ErrSeriesSet(err)
4545
}
46+
47+
// We will hit this for /series lookup when -querier.query-store-for-labels-enabled is set.
48+
// If we don't skip here, it'll make /series lookups extremely slow as all the chunks will be loaded.
49+
// That flag is only to be set with blocks storage engine, and this is a protective measure.
50+
if sp == nil || sp.Func == "series" {
51+
return storage.EmptySeriesSet()
52+
}
53+
4654
chunks, err := q.store.Get(q.ctx, userID, model.Time(sp.Start), model.Time(sp.End), matchers...)
4755
if err != nil {
4856
return storage.ErrSeriesSet(err)

0 commit comments

Comments
 (0)