Skip to content

Commit

Permalink
bucket: handle instances where no blocks are loaded (#2271)
Browse files Browse the repository at this point in the history
* bucket: handle instances where no blocks are loaded

Signed-off-by: Jacob Colvin <Jacob.Colvin@8451.com>

* bucket: reject all falsy label values

Signed-off-by: Jacob Colvin <Jacob.Colvin@8451.com>

* bucket: update changelog

Signed-off-by: Jacob Colvin <Jacob.Colvin@8451.com>
  • Loading branch information
MacroPower authored Mar 19, 2020
1 parent a87ed1b commit b53e337
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 72 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#2238](https://github.com/thanos-io/thanos/pull/2238) Ruler: Fixed Issue #2204 bug in alert queue signalling filled up queue and alerts were dropped
- [#2231](https://github.com/thanos-io/thanos/pull/2231) Bucket Web - Sort chunks by thanos.downsample.resolution for better grouping
- [#2254](https://github.com/thanos-io/thanos/pull/2254) Bucket: Fix metrics registered multiple times in bucket replicate
- [#2271](https://github.com/thanos-io/thanos/pull/2271) Bucket Web: Fixed Issue #2260 bucket passes null when storage is empty

### Added

Expand Down
4 changes: 3 additions & 1 deletion cmd/thanos/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,16 @@ func refresh(ctx context.Context, logger log.Logger, bucketUI *ui.Bucket, durati
})
}

func download(ctx context.Context, logger log.Logger, bkt objstore.Bucket, fetcher *block.MetaFetcher) (blocks []metadata.Meta, err error) {
func download(ctx context.Context, logger log.Logger, bkt objstore.Bucket, fetcher *block.MetaFetcher) ([]metadata.Meta, error) {
level.Info(logger).Log("msg", "synchronizing block metadata")

metas, _, err := fetcher.Fetch(ctx)
if err != nil {
return nil, err
}

blocks := []metadata.Meta{}

for _, meta := range metas {
blocks = append(blocks, *meta)
}
Expand Down
Loading

0 comments on commit b53e337

Please sign in to comment.