Skip to content

Commit

Permalink
Merge pull request thanos-io#1 from codesome/pracucci-prom-upgrade
Browse files Browse the repository at this point in the history
 Delete mmapped chunks after creating block from head
  • Loading branch information
pracucci committed May 26, 2020
2 parents 1a0b648 + 9728c77 commit 46e8802
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/testutil/e2eutil/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,17 @@ func createBlock(
resolution int64,
tombstones bool,
) (id ulid.ULID, err error) {
h, err := tsdb.NewHead(nil, nil, nil, 10000000000, dir, nil, tsdb.DefaultStripeSize, nil)
chunksRootDir := filepath.Join(dir, "chunks")
h, err := tsdb.NewHead(nil, nil, nil, 10000000000, chunksRootDir, nil, tsdb.DefaultStripeSize, nil)
if err != nil {
return id, errors.Wrap(err, "create head block")
}
defer runutil.CloseWithErrCapture(&err, h, "TSDB Head")
defer func() {
runutil.CloseWithErrCapture(&err, h, "TSDB Head")
if e := os.RemoveAll(chunksRootDir); e != nil {
err = errors.Wrap(e, "delete chunks dir")
}
}()

var g errgroup.Group
var timeStepSize = (maxt - mint) / int64(numSamples+1)
Expand Down

0 comments on commit 46e8802

Please sign in to comment.