Skip to content

Commit

Permalink
minor nits
Browse files Browse the repository at this point in the history
Signed-off-by: metonymic-smokey <ahuja.aditi@gmail.com>
  • Loading branch information
metonymic-smokey committed Dec 1, 2021
1 parent 9296528 commit 01812fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/compact/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ func (cg *Group) Compact(ctx context.Context, dir string, planner Planner, comp
}

var err error
tracing.DoInSpanWithErr(ctx, "group_compaction", func(ctx context.Context) error {
tracing.DoInSpanWithErr(ctx, "compaction_group", func(ctx context.Context) error {
shouldRerun, compID, err = cg.compact(ctx, subDir, planner, comp)
return err
}, opentracing.Tags{"group.key": cg.Key()})
Expand Down Expand Up @@ -1022,14 +1022,13 @@ func (cg *Group) compact(ctx context.Context, dir string, planner Planner, comp
err = block.Download(ctx, cg.logger, cg.bkt, meta.ULID, bdir)
return err
}, opentracing.Tags{"block.id": meta.ULID})

if err != nil {
return false, ulid.ULID{}, retry(errors.Wrapf(err, "download block %s", meta.ULID))
}

// Ensure all input blocks are valid.
var stats block.HealthStats
tracing.DoInSpanWithErr(ctx, "compaction_block_healthstats", func(ctx context.Context) error {
tracing.DoInSpanWithErr(ctx, "compaction_block_health_stats", func(ctx context.Context) error {
stats, err = block.GatherIndexHealthStats(cg.logger, filepath.Join(bdir, block.IndexFilename), meta.MinTime, meta.MaxTime)
return err
}, opentracing.Tags{"block.id": meta.ULID})
Expand Down
3 changes: 1 addition & 2 deletions pkg/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
opentracing_log "github.com/opentracing/opentracing-go/log"
)

const (
Expand Down Expand Up @@ -82,7 +81,7 @@ func DoInSpanWithErr(ctx context.Context, operationName string, doFn func(contex
defer span.Finish()
err := doFn(newCtx)
if err != nil {
ext.LogError(span, err, opentracing_log.Error(err))
ext.LogError(span, err)
}
}

Expand Down

0 comments on commit 01812fc

Please sign in to comment.