[SERVER-65735] $add operator should not use DoubleDoubleSummation in the classic engine Created: 18/Apr/22  Updated: 29/Oct/23  Resolved: 16/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Davis Haupt (Inactive) Assignee: Davis Haupt (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-63099 Constant folding should not assume ar... Closed
is depended on by TOOLS-3145 Investigate changes in SERVER-65735: ... Closed
Documented
is documented by DOCS-15420 [SERVER] Investigate changes in SERVE... Closed
Problem/Incident
causes SERVER-68396 Regression of $add aggregation expres... Closed
Related
related to SERVER-63018 Have ExpressionAdd::evaluate() return... Closed
related to SERVER-63099 Constant folding should not assume ar... Closed
is related to SERVER-67282 $add expression should not use Double... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v6.0, v5.3, v5.0, v4.4, v4.2
Sprint: QO 2022-05-02, QO 2022-05-16, QO 2022-05-30, QO 2022-06-13, QO 2022-06-27
Participants:
Linked BF Score: 12

 Description   

Discussed with geert.bosch@mongodb.com who implemented DoubleDoubleSummation in SERVER-19735 and we determined that DoubleDoubleSummation was implemented for use in $group aggregation operators like $sum where the user does not have control over the ordering of input arguments and there are consistently a very large number of values that need to be summed.

For the $add expression, where arguments are passed in explicitly by the end user, we should be prioritizing the behavior which is most clear and obvious and add doubles together normally. 

This ticket fell out of SERVER-63099, which is attempting to make $add behave the same with and without the constant folding optimization.

More background around this decision can be found in this writeup.



 Comments   
Comment by Githook User [ 15/Jun/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-65735 $add operator should not use DoubleDoubleSummation
Branch: master
https://github.com/mongodb/mongo/commit/62c5c0fdc0f896503ac861d014212772cdd6bc2b

Comment by Davis Haupt (Inactive) [ 09/May/22 ]

Property-based tests for left-to-right constant folding in SERVER-63099 are failing because of this bug.

Comment by Davis Haupt (Inactive) [ 28/Apr/22 ]

PR was approved, but moving to Waiting for Merge before clarifying whether this is safe to merge in without a scope / larger discussion.

Generated at Thu Feb 08 06:03:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.