[SERVER-60182] $group does not fail with QueryExceededMemoryLimit error when SBE $group pushdown turned on and it runs as sub-pipeline of $unionWith Created: 23/Sep/21  Updated: 27/Sep/21  Resolved: 27/Sep/21

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

Type: Bug Priority: Major - P3
Reporter: Yoon Soo Kim Assignee: Yoon Soo Kim
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-58436 Implement spilling HashAgg Closed
Operating System: ALL
Sprint: QE 2021-10-04
Participants:

 Description   

buildscripts/resmoke.py run --suites=aggregation --mongodSetParameters="{internalQueryEnableSlotBasedExecutionEngine: true}" --additionalFeatureFlags=featureFlagTimeseriesCollection,featureFlagSbePlanCache,featureFlagSBEGroupPushdown jstests/aggregation/sources/unionWith/unionWith.js

The failed test case:

// Test that a $group within a $unionWith sub-pipeline correctly fails if it needs to spill but
// 'allowDiskUse' is false.
assert.commandFailedWithCode(testDB.runCommand({
    aggregate: collA.getName(),
    pipeline: [
        {
            $unionWith: {
                coll: collB.getName(),
                pipeline: [
                    {"$group": {_id: "$groupKey", val: {$sum: "$val"}}},
                    {"$addFields": {groupKey: 1}}
                ]
            }
        },
    ],
    allowDiskUse: false,
    cursor: {}
}),
                             ErrorCodes.QueryExceededMemoryLimitNoDiskUseAllowed);



 Comments   
Comment by Eric Cox (Inactive) [ 27/Sep/21 ]

We will punt on this when we do spilling, for now we changed $sum to $min.

Generated at Thu Feb 08 05:49:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.