Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Don't hit ingesters if the query is in the future. #24

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/querier/unified_querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func newUnifiedChunkQueryable(ds, cs chunkstore.ChunkStore, distributor Distribu
}

// Include ingester only if maxt is within ingesterMaxQueryLookback w.r.t. current time.
if ingesterMaxQueryLookback == 0 || maxt >= time.Now().Add(-ingesterMaxQueryLookback).UnixNano()/1e6 {
// Also don't include the ingester if the query is totally in the future.
if (ingesterMaxQueryLookback == 0 || maxt >= time.Now().Add(-ingesterMaxQueryLookback).UnixNano()/1e6) &&
mint < time.Now().Add(5*time.Minute).UnixNano()/1e6 {
ucq.stores = append(ucq.stores, ds)
}

Expand Down