[SERVER-42659] Provide a dedicated error code/name for in-memory-sort-too-big errors Created: 07/Aug/19  Updated: 29/Oct/23  Resolved: 25/Oct/19

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

Type: New Feature Priority: Major - P3
Reporter: David Bartley Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-46109 Adopt QueryExceededMemoryLimitNoDiskU... Closed
Backwards Compatibility: Minor Change
Sprint: Query 2019-10-21, Query 2019-11-04
Participants:

 Description   

If your query needs an in-memory sort and that requires more than 32 MiB (by default) you'll get a generic error:

Error: error: {
	"ok" : 0,
	"errmsg" : "Executor error during find command :: caused by :: errmsg: \"Sort operation used more than the maximum 1048576 bytes of RAM. Add an index, or specify a smaller limit.\"",
	"code" : 96,
	"codeName" : "OperationFailed"
}

It'd be nice if this had a more specific error that you could programmatically match on.



 Comments   
Comment by Githook User [ 23/Oct/19 ]

Author:

{'username': 'jseyster', 'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster'}

Message: SERVER-42659 Reserve QueryExceededMemoryLimitNoDiskUseAllowed error

A follow-on patch will replace several unnamed error codes with this
new error code. Some changes to the multi-version fuzzer are necessary
before we can update query operations to use the new error code.
Branch: master
https://github.com/mongodb/mongo/commit/14a632d7e9fa012114bba49e61437bc80c4480b9

Comment by Charlie Swanson [ 14/Aug/19 ]

Related request on this pull request: https://github.com/mongodb/mongo/pull/1230

Comment by Kelsey Schubert [ 07/Aug/19 ]

Thanks for the suggestion, bartle. I've marked this ticket for scheduling.

Comment by David Bartley [ 07/Aug/19 ]

I tested on 3.6 but I don't believe master has changed, based on skimming the code.

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