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>
This commit is contained in:
parent
1cc02930b6
commit
73e2ce1bd6
|
@ -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…
Reference in New Issue