Skip to content

Commit

Permalink
Make sure bucket index load failure will not increase if there is con…
Browse files Browse the repository at this point in the history
…tenxt error
  • Loading branch information
alexqyle committed Jul 2, 2024
1 parent ea7a076 commit a065870
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/storage/tsdb/bucketindex/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ func (l *Loader) GetIndex(ctx context.Context, userID string) (*Index, Status, e
// (eg. corrupted bucket index or not existing).
l.cacheIndex(userID, nil, ss, err)

if ctx.Err() != nil {
level.Warn(util_log.WithContext(ctx, l.logger)).Log("msg", "received context error when reading bucket index", "err", ctx.Err())
return nil, UnknownStatus, ctx.Err()
}

if errors.Is(err, ErrIndexNotFound) {
level.Warn(l.logger).Log("msg", "bucket index not found", "user", userID)
} else if errors.Is(err, bucket.ErrCustomerManagedKeyAccessDenied) {
Expand Down

0 comments on commit a065870

Please sign in to comment.