From 78938c218d3acbc4201b33d896b83f41d35c2dd3 Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 5 Apr 2023 16:36:15 -0600 Subject: [PATCH 1/2] Fail through to next middleware when cant limit * When the query size limiter can't limit the query, fail through to the next middleware instead of erroring. This can happen, for example, when a query spans schemas. --- pkg/querier/queryrange/limits.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/querier/queryrange/limits.go b/pkg/querier/queryrange/limits.go index ba544126a7841..cfb0094e26de3 100644 --- a/pkg/querier/queryrange/limits.go +++ b/pkg/querier/queryrange/limits.go @@ -353,7 +353,8 @@ func (q *querySizeLimiter) Do(ctx context.Context, r queryrangebase.Request) (qu // Only support TSDB schemaCfg, err := q.getSchemaCfg(r) if err != nil { - return nil, httpgrpc.Errorf(http.StatusInternalServerError, "Failed to get schema config: %s", err.Error()) + level.Error(log).Log("msg", "failed to get schema config", "err", err) + return q.next.Do(ctx, r) } if schemaCfg.IndexType != config.TSDBType { return q.next.Do(ctx, r) From ec0109b333d10cb31799b93210146d65fefcbbd6 Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 5 Apr 2023 16:43:04 -0600 Subject: [PATCH 2/2] Update pkg/querier/queryrange/limits.go Co-authored-by: Owen Diehl --- pkg/querier/queryrange/limits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/querier/queryrange/limits.go b/pkg/querier/queryrange/limits.go index cfb0094e26de3..07821030db370 100644 --- a/pkg/querier/queryrange/limits.go +++ b/pkg/querier/queryrange/limits.go @@ -353,7 +353,7 @@ func (q *querySizeLimiter) Do(ctx context.Context, r queryrangebase.Request) (qu // Only support TSDB schemaCfg, err := q.getSchemaCfg(r) if err != nil { - level.Error(log).Log("msg", "failed to get schema config", "err", err) + level.Error(log).Log("msg", "failed to get schema config, not applying querySizeLimit", "err", err) return q.next.Do(ctx, r) } if schemaCfg.IndexType != config.TSDBType {