lib/storage: do not store inf values, since they may lead to significant precision loss for previously stored values

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/752
This commit is contained in:
Aliaksandr Valialkin 2020-09-11 14:44:23 +03:00
parent 8bd5aa3516
commit 81c05f669b

View File

@ -1196,6 +1196,11 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra
// doesn't know how to work with them. // doesn't know how to work with them.
continue continue
} }
if math.IsInf(mr.Value, 0) {
// Skip Inf values, since they may break precision for already stored data.
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/752
continue
}
if mr.Timestamp < minTimestamp { if mr.Timestamp < minTimestamp {
// Skip rows with too small timestamps outside the retention. // Skip rows with too small timestamps outside the retention.
if firstWarn == nil { if firstWarn == nil {