Skip to content

Commit

Permalink
cleanup after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Berkley <[email protected]>
  • Loading branch information
nberkley committed Dec 16, 2021
1 parent 3e370cc commit 2a5605d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 37 deletions.
2 changes: 1 addition & 1 deletion cmd/thanos/downsample.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func processDownsampling(
downsampleDuration := time.Since(begin)
level.Info(logger).Log("msg", "downsampled block",
"from", m.ULID, "to", id, "duration", downsampleDuration, "duration_ms", downsampleDuration.Milliseconds())
metrics.downsampleDuration.WithLabelValues(compact.DefaultGroupKey(m.Thanos)).Observe(downsampleDuration.Seconds())
metrics.downsampleDuration.WithLabelValues(m.Thanos.GroupKey()).Observe(downsampleDuration.Seconds())

if err := block.VerifyIndex(logger, filepath.Join(resdir, block.IndexFilename), m.MinTime, m.MaxTime); err != nil {
return errors.Wrap(err, "output block index not valid")
Expand Down
2 changes: 1 addition & 1 deletion cmd/thanos/tools_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func registerBucketWeb(app extkingpin.AppClause, objStoreConfig *extflag.PathOrC
[]block.MetadataFilter{
block.NewTimePartitionMetaFilter(filterConf.MinTime, filterConf.MaxTime),
block.NewLabelShardedMetaFilter(relabelConfig),
block.NewDeduplicateFilter(),
block.NewDeduplicateFilter(block.FetcherConcurrency),
}, nil)
if err != nil {
return err
Expand Down
32 changes: 0 additions & 32 deletions pkg/block/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
"github.com/prometheus/prometheus/tsdb"
"golang.org/x/sync/errgroup"
"gopkg.in/yaml.v2"

Expand Down Expand Up @@ -673,37 +672,6 @@ func (f *DeduplicateFilter) DuplicateIDs() []ulid.ULID {
return f.duplicateIDs
}

<<<<<<< HEAD
func addNodeBySources(root, add *Node) bool {
var rootNode *Node
childSources := add.Compaction.Sources
for _, node := range root.Children {
parentSources := node.Compaction.Sources

// Block exists with same sources, add as child.
if contains(parentSources, childSources) && contains(childSources, parentSources) {
node.Children = append(node.Children, add)
return true
}

// Block's sources are present in other block's sources, add as child.
if contains(parentSources, childSources) {
rootNode = node
break
}
}

// Block cannot be attached to any child nodes, add it as child of root.
if rootNode == nil {
root.Children = append(root.Children, add)
return true
}

return addNodeBySources(rootNode, add)
}

=======
>>>>>>> Move group key function to the metadata package. Deduplicate within compaction groups and in parallel.
func contains(s1, s2 []ulid.ULID) bool {
for _, a := range s2 {
found := false
Expand Down
6 changes: 3 additions & 3 deletions pkg/compact/compact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func TestRetentionProgressCalculate(t *testing.T) {
m[2].Thanos.Labels = map[string]string{"a": "1", "b": "2"}
m[2].Thanos.Downsample.Resolution = downsample.ResLevel2
for ind, meta := range m {
keys[ind] = DefaultGroupKey(meta.Thanos)
keys[ind] = meta.Thanos.GroupKey()
}

ps := NewRetentionProgressCalculator(reg, nil)
Expand Down Expand Up @@ -369,7 +369,7 @@ func TestCompactProgressCalculate(t *testing.T) {
m[2].Thanos.Labels = map[string]string{"a": "1", "b": "2"}
m[2].Thanos.Downsample.Resolution = 1
for ind, meta := range m {
keys[ind] = DefaultGroupKey(meta.Thanos)
keys[ind] = meta.Thanos.GroupKey()
}

ps := NewCompactionProgressCalculator(reg, planner)
Expand Down Expand Up @@ -491,7 +491,7 @@ func TestDownsampleProgressCalculate(t *testing.T) {
m[2].Thanos.Labels = map[string]string{"a": "1", "b": "2"}
m[2].Thanos.Downsample.Resolution = downsample.ResLevel2
for ind, meta := range m {
keys[ind] = DefaultGroupKey(meta.Thanos)
keys[ind] = meta.Thanos.GroupKey()
}

ds := NewDownsampleProgressCalculator(reg)
Expand Down

0 comments on commit 2a5605d

Please sign in to comment.