[SERVER-60181] Applying insert-only doc-diffs should not require insert in StringMap Created: 23/Sep/21  Updated: 29/Oct/23  Resolved: 12/Oct/21

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

Type: Improvement Priority: Major - P3
Reporter: Henrik Edin Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-10-18
Participants:
Linked BF Score: 135

 Description   

When preparing the docDiff for apply we put the insert field in a StringMap: https://github.com/mongodb/mongo/blob/92738c5fa0e8169299e5393e88159b8cbb9559ca/src/mongo/db/update/document_diff_applier.cpp#L106

However, if it is an insert-only workload this map is not used and we just read from the insert vector: https://github.com/mongodb/mongo/blob/92738c5fa0e8169299e5393e88159b8cbb9559ca/src/mongo/db/update/document_diff_applier.cpp#L495-L504

This should cut a StringMap insert for every measurement in time-series inserts.



 Comments   
Comment by Githook User [ 08/Oct/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-60181 Avoid pushing insert-only diffs to StringMap when applying docDiff

Also fix usage of reserveBytes when applying docDiff. Reserved bytes need to be claimed.
Branch: master
https://github.com/mongodb/mongo/commit/67bc82b140451138e4bf10682ad92289980c2add

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