Skip to content

Cherry-pick: MOD-14420 fix count reducers return wrong NaN (#2013) - #2017

Merged
AvivDavid23 merged 1 commit into
8.6from
cherry-pick-9b1827c2-to-8.6
May 5, 2026
Merged

AvivDavid23 merged 1 commit into
8.6from
cherry-pick-9b1827c2-to-8.6

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

MOD-14420 fix count reducers return wrong NaN (#2013)

Cherry-pick of 9b1827c onto 8.6

Made with Cursor


Note

Medium Risk
Adjusts GROUPBY ... REDUCE aggregation behavior for NaN-only timestamp buckets, which can affect query results for count-style reducers. Limited scope but touches core aggregation logic used by TS.MRANGE/TS.MREVRANGE.

Overview
Fixes GROUPBY ... REDUCE handling of NaN-only samples in MultiSeriesAggDupSampleIterator_GetNext: the iterator now uses the reducer’s isValueValid to track whether any valid values were seen for a timestamp, and only finalizes normally when such values exist.

When no valid values exist, count-style reducers (count, countnan, countall) now finalize via finalizeEmpty (returning 0) instead of propagating NaN, while other reducers continue to return NaN. Adds a flow test covering count/countnan/countall behavior with mixed and all-NaN inputs.

Reviewed by Cursor Bugbot for commit 8482d93. Bugbot is set up for automated code reviews on this repo. Configure here.

* MOD-14420 fix count reducers return wrong NaN

* fix empty issue

* format
@AvivDavid23
AvivDavid23 enabled auto-merge (squash) May 5, 2026 11:46
@sonarqubecloud

sonarqubecloud Bot commented May 5, 2026

Copy link
Copy Markdown

@AvivDavid23
AvivDavid23 merged commit 4f79982 into 8.6 May 5, 2026
52 of 57 checks passed
@AvivDavid23
AvivDavid23 deleted the cherry-pick-9b1827c2-to-8.6 branch May 5, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants