Skip to content

Commit

Permalink
Do not fail queries if compactor returns unexpected status code (#6552)…
Browse files Browse the repository at this point in the history
… (#6683)

To avoid showing deleted data, the querier originally failed when
deletes were unavailable. If the compactor becomes unavailable this can
cause Loki to stop responding to queries altogether. This PR changes the
querier to log an error but continue servicing the request when it fails
to get deletes.

Extends PR #6368

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
(cherry picked from commit a1745c7)

Co-authored-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
grafanabot and chaudum authored Jul 14, 2022
1 parent 54e25c8 commit 5a5c8c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (q *SingleTenantQuerier) SelectLogs(ctx context.Context, params logql.Selec

params.QueryRequest.Deletes, err = q.deletesForUser(ctx, params.Start, params.End)
if err != nil {
return nil, err
level.Error(spanlogger.FromContext(ctx)).Log("msg", "failed loading deletes for user", "err", err)
}

ingesterQueryInterval, storeQueryInterval := q.buildQueryIntervals(params.Start, params.End)
Expand Down Expand Up @@ -411,7 +411,7 @@ func (q *SingleTenantQuerier) Tail(ctx context.Context, req *logproto.TailReques

deletes, err := q.deletesForUser(ctx, req.Start, time.Now())
if err != nil {
return nil, err
level.Error(spanlogger.FromContext(ctx)).Log("msg", "failed loading deletes for user", "err", err)
}

histReq := logql.SelectLogParams{
Expand Down

0 comments on commit 5a5c8c6

Please sign in to comment.