diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index 7b70751288..d10c40a861 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -955,11 +955,11 @@ func newRollupHoltWinters(args []interface{}) (rollupFunc, error) { return rfa.prevValue } sf := sfs[rfa.idx] - if sf <= 0 || sf >= 1 { + if sf < 0 || sf > 1 { return nan } tf := tfs[rfa.idx] - if tf <= 0 || tf >= 1 { + if tf < 0 || tf > 1 { return nan } diff --git a/app/vmselect/promql/rollup_test.go b/app/vmselect/promql/rollup_test.go index 12a3b0acbc..766a33eaea 100644 --- a/app/vmselect/promql/rollup_test.go +++ b/app/vmselect/promql/rollup_test.go @@ -470,12 +470,12 @@ func TestRollupHoltWinters(t *testing.T) { } f(-1, 0.5, nan) - f(0, 0.5, nan) - f(1, 0.5, nan) + f(0, 0.5, -856) + f(1, 0.5, 34) f(2, 0.5, nan) f(0.5, -1, nan) - f(0.5, 0, nan) - f(0.5, 1, nan) + f(0.5, 0, -54.1474609375) + f(0.5, 1, 25.25) f(0.5, 2, nan) f(0.5, 0.5, 34.97794532775879) f(0.1, 0.5, -131.30529492371622)