[SERVER-29162] UpdateNode implementation should only validate modified fields Created: 12/May/17  Updated: 30/Oct/23  Resolved: 30/Jun/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Tess Avitabile (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-29819 Can create invalid dbref using $unset... Closed
Related
related to SERVER-28762 Conditionally parse an update express... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2017-07-10
Participants:
Linked BF Score: 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.



 Comments   
Comment by Ramon Fernandez Marina [ 25/Aug/17 ]

Author:

{'username': u'jimoleary', 'name': u'Jim OLeary', 'email': u'jim.oleary@gmail.com'}

Message:BF-5761 delete override , SERVER-29162 fixed regression in SERVER-28762
Branch:master
https://github.com/10gen/dsi/commit/240c4c3360008ddd4c690e907d280e504cee43bc

Comment by Githook User [ 30/Jun/17 ]

Author:

{u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

Message: SERVER-29162 UpdateNode implementation should only validate modified fields
Branch: master
https://github.com/mongodb/mongo/commit/07baac065147381842a172726a5f80d7e57a6ef8

Comment by Githook User [ 20/Jun/17 ]

Author:

{u'username': u'stauffec', u'name': u'Cristopher Stauffer', u'email': u'cristopher.stauffer@mongodb.com'}

Message: BF-5761: Adding overrides for update/multiUpdate tests to temporarily expect lower values until SERVER-29162 is resolved.
Branch: master
https://github.com/10gen/dsi/commit/64483f48c68f2ffd3394405ca1a0683bcd3161e2

Generated at Thu Feb 08 04:20:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.