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

UpdateNode implementation should only validate modified fields

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.10
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Query 2017-07-10
    • 0

      The UpdateStage validates the updated document to ensure that it has no $-prefixed names, no immutable fields are changed (shard key and _id), and the document does not exceed the maximum BSON depth. The old implementation reports which fields are modified, so the validation only checks modified fields. The new UpdateNode implementation does not report which fields are modified, so the validation checks the entire document. This leads to a large performance regression, so the UpdateNode implementation should ensure that only modified fields are checked.

      Note that we should avoid putting all array elements modified by an array update into a FieldRefSet, as this will likely be very expensive when many array elements are updated. Instead, we could handle validation at the leaves of the UpdateNode tree, or, if there is an array update on array field a, we could report that the entire field a was modified, so the UpdateStage will validate the entire field a.

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: