Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50771

The BSONValidate fast path should support a depth of 32

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • Execution Team 2020-09-21
    • 0

      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.

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: