[SERVER-48629] Ensure BSON nesting depth error messages refer to documented limit Created: 05/Jun/20  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Storage Execution
Participants:

 Description   

Nested Depth for BSON Documents documents a fix limit of 100 with no mention of this being configurable. While this can be altered via the undocumented maxBSONDepth server parameter, henrik.edin clarified that it is mainly used for internal testing and the edge case of nested BSON (e.g. CodeWScope within a nesting level, where its scope has its own nesting).

Quoting divjot.arora from the linked HELP ticket:

As I mentioned in a previous comment, the fact that it was documented to be 100 almost caused us to make a mistake in a feature implementation. These limits are also mentioned in the error messages themselves. Testing on a 4.2.6 server, I got this error when using a 201-level filter for the find command: (Overflow) BSONObj exceeded maximum nested object depth: 200 and this error when inserting a 200-level document: cannot insert document because it exceeds 180 levels of nesting. As an aside, I wasn't aware that the limits are different for inserting vs finding.

Either way, these limits are incorrectly documented and also included in our error messages. Leaving this as-is just seems confusing.

The requested action in this ticket is to ensure that any error messages that may be exposed to users consistently refer to the documented limit of 100.



 Comments   
Comment by Brooke Miller [ 08/Jun/20 ]

Re-assigned to Execution since they introduced the maxBSONDepth server parameter.

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