Skip to content

Commit b57aef3

Browse files
committed
Check for enough ingesters before querying
If we're only going to error anyway, might as well do it quickly.
1 parent 3537aec commit b57aef3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

distributor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ func (d *Distributor) Query(ctx context.Context, from, to model.Time, matchers .
263263
return err
264264
}
265265

266+
if len(ingesters) < d.cfg.MinReadSuccesses {
267+
return fmt.Errorf("Could only find %d ingesters for query. Need at least %d", len(ingesters), d.cfg.MinReadSuccesses)
268+
}
269+
266270
// Fetch samples from multiple ingesters and group them by fingerprint (unsorted
267271
// and with overlap).
268272
successes := 0

0 commit comments

Comments
 (0)