diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index c711f04ad8..2685f72ca7 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -1142,10 +1142,10 @@ func rollupSum(rfa *rollupFuncArg) float64 { // before calling rollup funcs. values := rfa.values if len(values) == 0 { - if math.IsNaN(rfa.prevValue) { - return nan - } - return 0 + // Do not take into account rfa.prevValue, since it may lead + // to inconsistent results comparing to Prometheus on broken time series + // with irregular data points. + return nan } var sum float64 for _, v := range values {