[SERVER-37429] $avg of Infinity and null is NaN on debug builds Created: 02/Oct/18  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 4.0.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Robert Guo (Inactive) Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: afz, query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-42854 $avg with Infinity can incorrectly re... Closed
Related
related to SERVER-42616 $stdDev accumulator can return imprec... Backlog
related to SERVER-37668 Disable the aggregation fuzzer on Win... Closed
related to SERVER-37672 Re-enable agg fuzzer on debug builds Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Steps To Reproduce:

MongoDB Enterprise > db.test.find()
{ "_id" : 1, "a" : Infinity }
{ "_id" : 2, "a" : null }
MongoDB Enterprise > db.test.aggregate([{$group:{_id: null, num:{$avg:"$a"}}}])
{ "_id" : null, "num" : NaN } // debug build
{ "_id" : null, "num" : Infinity } // non-debug build, correct behavior.

Participants:
Linked BF Score: 0

 Comments   
Comment by Robert Guo (Inactive) [ 22/Aug/19 ]

We already disabled the debug agg multiversion fuzzer on debug builds in SERVER-37668. There are no immediate plans to re-enable debug builds. No BFs are caused by this ticket at the moment.

I think this ticket is for addressing the NaN vs Infinity discrepancy when spilling to disk. It's not related to debug vs non-debug based on Max's comment above.

Comment by Charlie Swanson [ 22/Aug/19 ]

robert.guo our understanding is that failures like this will stop happening in evergreen soon due to disabling debug variants of the multi version fuzzer. Can you confirm?

If that's correct we're going to keep this on the backlog until we make time for configuring a spilling to disk variant of the aggregation fuzzer.

Comment by Max Hirschhorn [ 13/Aug/19 ]

I think this ticket was sitting on the STM team backlog in order for us to do some further investigation. After charlie.swanson mentioned how the $group stage always spills to disk in --dbg=on builds, I believe that is what's happening here.

Generated at Thu Feb 08 04:45:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.