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 a2f647d142
commit 5a90a92378

View file

@ -1120,6 +1120,11 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra
// doesn't know how to work with them.
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 {
// Skip rows with too small timestamps outside the retention.
if firstWarn == nil {