Skip to content

Commit

Permalink
Removed block after each compaction group run.
Browse files Browse the repository at this point in the history
Fixes: #1499

Signed-off-by: Bartek Plotka <[email protected]>
  • Loading branch information
bwplotka committed Oct 18, 2019
1 parent 0c6f3a1 commit 0ec1e20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/compact/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,12 @@ func (cg *Group) Compact(ctx context.Context, dir string, comp tsdb.Compactor) (

subDir := filepath.Join(dir, cg.Key())

defer func() {
if err := os.RemoveAll(subDir); err != nil {
level.Error(cg.logger).Log("msg", "failed to remove compaction group work directory", "path", subDir, "err", err)
}
}()

if err := os.RemoveAll(subDir); err != nil {
return false, ulid.ULID{}, errors.Wrap(err, "clean compaction group dir")
}
Expand Down

0 comments on commit 0ec1e20

Please sign in to comment.