[SERVER-52974] Checking if destined recipient has changed for resharding creates another full copy of the updated document Created: 20/Nov/20  Updated: 29/Oct/23  Resolved: 21/Nov/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: PM-234-M2, PM-234-T-oplog-fetch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-49825 Replicate updates changing value unde... Closed
Related
related to SERVER-54040 Resharding may fail to throw WouldCha... Closed
related to SERVER-57666 Convert getDestinedRecipient() in res... Closed
related to SERVER-58918 Replace getDestinedRecipient() in the... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2020-11-30
Participants:
Linked BF Score: 0

 Description   

mutablebson::Document::getObject() renders a full copy of the updated document. This can be expensive for larger documents. At minimum we should skip calling it when the collection isn't even sharded like UpdateStage::checkUpdateChangesShardKeyFields() does. Better would be to consolidate some the _doc.getObject() calls that UpdateStage::checkUpdateChangesShardKeyFields(), UpdateStage::wasReshardingKeyUpdated(), and updates which weren't performed in-place all do.



 Comments   
Comment by Githook User [ 21/Nov/20 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-52974 Avoid extra calls to _doc.getObject() in update codepath.
Branch: master
https://github.com/mongodb/mongo/commit/c65e9fc4390adfde4f3f551d5fcdd0415e028a6b

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