Don't call runtime.GC() after compaction (#8276)

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
This commit is contained in:
Ganesh Vernekar 2020-12-22 20:14:17 +05:30 committed by GitHub
parent caa173d2aa
commit faa1554aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 5 deletions

View File

@ -22,7 +22,6 @@ import (
"math"
"os"
"path/filepath"
"runtime"
"sort"
"strconv"
"strings"
@ -875,7 +874,6 @@ func (db *DB) compactHead(head *RangeHead) error {
return errors.Wrap(err, "persist head block")
}
runtime.GC()
if err := db.reloadBlocks(); err != nil {
if errRemoveAll := os.RemoveAll(filepath.Join(db.dir, uid.String())); errRemoveAll != nil {
return tsdb_errors.NewMulti(
@ -888,7 +886,6 @@ func (db *DB) compactHead(head *RangeHead) error {
if err = db.head.truncateMemory(head.BlockMaxTime()); err != nil {
return errors.Wrap(err, "head memory truncate")
}
runtime.GC()
return nil
}
@ -915,7 +912,6 @@ func (db *DB) compactBlocks() (err error) {
if err != nil {
return errors.Wrapf(err, "compact %s", plan)
}
runtime.GC()
if err := db.reloadBlocks(); err != nil {
if err := os.RemoveAll(filepath.Join(db.dir, uid.String())); err != nil {
@ -923,7 +919,6 @@ func (db *DB) compactBlocks() (err error) {
}
return errors.Wrap(err, "reloadBlocks blocks")
}
runtime.GC()
}
return nil