lib/storage: fix inconsistencies in error logs

This commit is contained in:
Aliaksandr Valialkin 2021-02-10 15:56:07 +02:00
parent 148422bcba
commit 681dfb7485

View file

@ -844,7 +844,9 @@ func mustGetMinTimestampForCompositeIndex(metadataDir string, isEmptyDB bool) in
if err == nil {
return minTimestamp
}
logger.Errorf("cannot read minTimestampForCompositeIndex, so trying to re-create it; error: %s", err)
if !os.IsNotExist(err) {
logger.Errorf("cannot read minTimestampForCompositeIndex, so trying to re-create it; error: %s", err)
}
date := time.Now().UnixNano() / 1e6 / msecPerDay
if !isEmptyDB {
// The current and the next day can already contain non-composite indexes,
@ -1616,7 +1618,7 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra
atomic.AddUint64(&s.slowRowInserts, slowInsertsCount)
}
if firstWarn != nil {
logger.Errorf("warn occurred during rows addition: %s", firstWarn)
logger.Warnf("warn occurred during rows addition: %s", firstWarn)
}
rows = rows[:rowsLen+j]