Adds an affirmative log message for successful WAL repair (#12135)

* Adds an affirmative log message for successful WAL repair

Signed-off-by: Vernon Miller <vernon.miller@grafana.com>
Signed-off-by: Vernon Miller <96601789+aldernero@users.noreply.github.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
This commit is contained in:
Vernon Miller 2023-03-21 08:03:43 -06:00 committed by GitHub
parent fd8992cdbd
commit ca0abf26c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -303,6 +303,7 @@ func Open(l log.Logger, reg prometheus.Registerer, rs *remote.Storage, dir strin
if err := w.Repair(err); err != nil { if err := w.Repair(err); err != nil {
return nil, errors.Wrap(err, "repair corrupted WAL") return nil, errors.Wrap(err, "repair corrupted WAL")
} }
level.Info(db.logger).Log("msg", "successfully repaired WAL")
} }
go db.run() go db.run()

View file

@ -828,11 +828,13 @@ func open(dir string, l log.Logger, r prometheus.Registerer, opts *Options, rngs
if err := wbl.Repair(initErr); err != nil { if err := wbl.Repair(initErr); err != nil {
return nil, errors.Wrap(err, "repair corrupted OOO WAL") return nil, errors.Wrap(err, "repair corrupted OOO WAL")
} }
level.Info(db.logger).Log("msg", "Successfully repaired OOO WAL")
} else { } else {
level.Warn(db.logger).Log("msg", "Encountered WAL read error, attempting repair", "err", initErr) level.Warn(db.logger).Log("msg", "Encountered WAL read error, attempting repair", "err", initErr)
if err := wal.Repair(initErr); err != nil { if err := wal.Repair(initErr); err != nil {
return nil, errors.Wrap(err, "repair corrupted WAL") return nil, errors.Wrap(err, "repair corrupted WAL")
} }
level.Info(db.logger).Log("msg", "Successfully repaired WAL")
} }
} }