Add logging during WAL replay

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
This commit is contained in:
Chris Marchbanks 2019-07-13 11:10:44 -06:00
parent 3bc1ea3d75
commit 0cd46f8762
No known key found for this signature in database
GPG Key ID: B7FD940BC86A8E7A
1 changed files with 3 additions and 0 deletions

View File

@ -502,6 +502,7 @@ func (h *Head) Init(minValidTime int64) error {
return nil return nil
} }
level.Info(h.logger).Log("msg", "replaying WAL, this may take awhile")
// Backfill the checkpoint first if it exists. // Backfill the checkpoint first if it exists.
dir, startFrom, err := LastCheckpoint(h.wal.Dir()) dir, startFrom, err := LastCheckpoint(h.wal.Dir())
if err != nil && err != ErrNotFound { if err != nil && err != ErrNotFound {
@ -525,6 +526,7 @@ func (h *Head) Init(minValidTime int64) error {
return errors.Wrap(err, "backfill checkpoint") return errors.Wrap(err, "backfill checkpoint")
} }
startFrom++ startFrom++
level.Info(h.logger).Log("msg", "WAL checkpoint loaded")
} }
// Find the last segment. // Find the last segment.
@ -548,6 +550,7 @@ func (h *Head) Init(minValidTime int64) error {
if err != nil { if err != nil {
return err return err
} }
level.Info(h.logger).Log("msg", "WAL segment loaded", "segment", i, "maxSegment", last)
} }
return nil return nil