[SERVER-50771] The BSONValidate fast path should support a depth of 32 Created: 04/Sep/20  Updated: 29/Oct/23  Resolved: 08/Sep/20

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

Type: Improvement Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-09-21
Participants:
Linked BF Score: 0

 Description   

BSONValidate has a fast path avoiding dynamic memory allocation that currently handles up to 16 levels of nesting. The structure of database commands themselves add some levels in addition to that of nesting depth of the document acted on. So, it is conceivable that there are actual use cases where the current limit of 16 may unnecessarily result in fallback to the slower dynamically sized implementation.

Changing the fast path maximum frame depth to 32 adds 8 * 16 = 128 bytes to the stack requirements of BSONValidate, which seems a reasonable trade-off.



 Comments   
Comment by Githook User [ 08/Sep/20 ]

Author:

{'name': 'Geert Bosch', 'email': 'geert@mongodb.com', 'username': 'GeertBosch'}

Message: SERVER-50771 The BSONValidate fast path should support a depth of 32
Branch: master
https://github.com/mongodb/mongo/commit/121f2ba8052dcacd942e017391b3bfb1a6bc9ca6

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