Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Commit 66b0380

Browse files
author
Krasi Georgiev
committed
less verbose logging.
Signed-off-by: Krasi Georgiev <[email protected]>
1 parent 82d85d0 commit 66b0380

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scan.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (s *DBScanner) RepairIndex() (map[string]IndexStats, error) {
157157
continue
158158
}
159159

160-
level.Info(s.logger).Log("msg", "detected index corruption", "path", indexPath, "err", err)
160+
level.Debug(s.logger).Log("msg", "detected index corruption", "path", indexPath, "err", err)
161161

162162
if statsBefore.ChunksPartialOutsiders > statsBefore.ChunksEntireOutsiders {
163163
level.Warn(s.logger).Log("msg", "detected outsiders are not all 'complete' outsiders. We can safely delete only complete outsiders", indexPath)
@@ -236,7 +236,7 @@ func (s *DBScanner) RepairIndex() (map[string]IndexStats, error) {
236236
level.Error(s.logger).Log("msg", "failed to repair index", "path", indexPath, "err", err)
237237
continue
238238
}
239-
level.Info(s.logger).Log("msg", "repaired index", "old index", indexPath, "new index", newIndexPath)
239+
level.Debug(s.logger).Log("msg", "repaired index", "old index", indexPath, "new index", newIndexPath)
240240
repairedIndexes[indexPath] = statsBefore
241241

242242
if err := os.RemoveAll(bdir); err != nil {

scan_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package tsdb
1515

1616
import (
17-
"os"
1817
"testing"
1918

2019
"github.com/go-kit/kit/log"
@@ -218,9 +217,10 @@ func TestRepairIndex(t *testing.T) {
218217
}
219218

220219
// Repair the index.
221-
scanner, err := NewDBScanner(db.dir, log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)))
220+
scanner, err := NewDBScanner(db.dir, log.NewNopLogger())
221+
testutil.Ok(t, err)
222+
_, err = scanner.RepairIndex()
222223
testutil.Ok(t, err)
223-
testutil.Ok(t, scanner.RepairIndex())
224224

225225
testutil.Ok(t, db.reload())
226226

0 commit comments

Comments
 (0)