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

UpdateNode implementation should only validate modified fields

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.5.10
    • Querying
    • None
    • Fully Compatible
    • ALL
    • Query 2017-07-10
    • 0

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: