Skip to content

Commit

Permalink
bucket verify: sort metas by MinTime before overlap check
Browse files Browse the repository at this point in the history
  • Loading branch information
mreichardt95 committed Mar 23, 2019
1 parent e756fe1 commit f03bb13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

### Fixed
- [#921](https://github.com/improbable-eng/thanos/pull/921) `thanos_objstore_bucket_last_successful_upload_time` now does not appear when no blocks have been uploaded so far
- [#966](https://github.com/improbable-eng/thanos/pull/966) Bucket: verify no longer warns about overlapping blocks, that overlap `0s`

## [v0.3.2](https://github.com/improbable-eng/thanos/releases/tag/v0.3.2) - 2019.03.04

Expand Down
7 changes: 6 additions & 1 deletion pkg/verifier/overlapped_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package verifier

import (
"context"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/improbable-eng/thanos/pkg/block"
Expand All @@ -11,6 +10,7 @@ import (
"github.com/oklog/ulid"
"github.com/pkg/errors"
"github.com/prometheus/tsdb"
"sort"
)

const OverlappedBlocksIssueID = "overlapped_blocks"
Expand Down Expand Up @@ -66,6 +66,11 @@ func fetchOverlaps(ctx context.Context, logger log.Logger, bkt objstore.Bucket)

overlaps := map[string]tsdb.Overlaps{}
for k, groupMetas := range metas {

sort.Slice(groupMetas, func(i, j int) bool {
return groupMetas[i].MinTime < groupMetas[j].MinTime
})

o := tsdb.OverlappingBlocks(groupMetas)
if len(o) > 0 {
overlaps[k] = o
Expand Down

0 comments on commit f03bb13

Please sign in to comment.