[SERVER-66989] Make HashAgg record store key owned Created: 02/Jun/22  Updated: 29/Oct/23  Resolved: 13/Jun/22

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

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Steps To Reproduce:

(function() {
"use strict";
 
const memoryLimitMb = 1;
const memoryLimitBytes = memoryLimitMb * 1024 * 1024;
 
// Start mongod with reduced memory limit for the $group stage.
const conn = MongoRunner.runMongod({
    setParameter: {
        internalDocumentSourceGroupMaxMemoryBytes: memoryLimitBytes,
        internalQuerySlotBasedExecutionHashAggApproxMemoryUseInBytesBeforeSpill: memoryLimitBytes
    }
});
const testDb = conn.getDB(jsTestName());
 
// Create a collection exceeding the memory limit.
testDb.largeColl.drop();
const largeStr = "A".repeat(1024 * 1024);  // 1MB string
for (let i = 0; i < memoryLimitMb + 1; ++i)
    assert.commandWorked(testDb.largeColl.insert({x: i, largeStr: largeStr + i}));
 
const pipeline = [{$group: {_id: '$largeStr', minId: {$min: '$_id'}}}];
// Make sure that the pipeline needs to spill to disk.
assert.throwsWithCode(() => testDb.largeColl.aggregate(pipeline, {allowDiskUse: false}),
                      ErrorCodes.QueryExceededMemoryLimitNoDiskUseAllowed);
testDb.largeColl.aggregate(pipeline);
 
MongoRunner.stopMongod(conn);
})();

Sprint: QE 2022-06-13, QE 2022-06-27
Participants:

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

Author:

{'name': 'Eric Cox', 'email': 'eric.cox@mongodb.com', 'username': 'ericox'}

Message: SERVER-66989 Make HashAgg record store key owned

(cherry picked from commit e399422548621ca737903284e8b435c804bb8254)
Branch: v6.0
https://github.com/mongodb/mongo/commit/acaf760974171260d12d976124e412c36f6ea5d6

Comment by Githook User [ 16/Jun/22 ]

Author:

{'name': 'Eric Cox', 'email': 'eric.cox@mongodb.com', 'username': 'ericox'}

Message: SERVER-66989 Make HashAgg record store key owned

(cherry picked from commit e399422548621ca737903284e8b435c804bb8254)
Branch: v6.0
https://github.com/mongodb/mongo/commit/342552401af6b49d37bdc2a507c5524642bb4e95

Comment by Githook User [ 13/Jun/22 ]

Author:

{'name': 'Eric Cox', 'email': 'eric.cox@mongodb.com', 'username': 'ericox'}

Message: SERVER-66989 Make HashAgg record store key owned
Branch: master
https://github.com/mongodb/mongo/commit/e399422548621ca737903284e8b435c804bb8254

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