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
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)
  • Loading branch information
chaudum authored and grafanabot committed Jun 30, 2022
1 parent d9a522e commit bdc8106
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 @@ -122,7 +122,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 @@ -417,7 +417,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 bdc8106

Please sign in to comment.