Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket: verify sort metas by MinTime before overlap check #966

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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