Browse Source

Do not ignore reload errors in compactHead (#8051)

* Modified unknownRefs to unknownRefs.Load()

Signed-off-by: GayathriVenkatesh <gayaa2010@gmail.com>

* Modified db.go

Signed-off-by: GayathriVenkatesh <gayaa2010@gmail.com>

* Revert "Modified unknownRefs to unknownRefs.Load()"

This reverts commit 79caf595fa9b9193878dc0dd9dec17d58851ae42.

Signed-off-by: GayathriVenkatesh <gayaa2010@gmail.com>

* Made changes to reload error in db.go

Signed-off-by: GayathriVenkatesh <gayaa2010@gmail.com>
pull/8054/head
Gayathri Venkatesh 4 years ago committed by GitHub
parent
commit
73e2ce1bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      tsdb/db.go

7
tsdb/db.go

@ -835,8 +835,11 @@ func (db *DB) compactHead(head *RangeHead) (err error) {
runtime.GC()
if err := db.reload(); err != nil {
if err := os.RemoveAll(filepath.Join(db.dir, uid.String())); err != nil {
return errors.Wrapf(err, "delete persisted head block after failed db reload:%s", uid)
if errRemoveAll := os.RemoveAll(filepath.Join(db.dir, uid.String())); errRemoveAll != nil {
var merr tsdb_errors.MultiError
merr.Add(errors.Wrap(err, "reload blocks"))
merr.Add(errors.Wrapf(errRemoveAll, "delete persisted head block after failed db reload:%s", uid))
return merr.Err()
}
return errors.Wrap(err, "reload blocks")
}

Loading…
Cancel
Save