[SERVER-56441] Avoid allocate and copy metadata if we successfully lookup existing bucket Created: 28/Apr/21  Updated: 29/Oct/23  Resolved: 03/May/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

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

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-05-03, Execution Team 2021-05-17
Participants:

 Description   

After SERVER-55213 we are no longer creating a modified metadata BSONObj when creating BucketKey when inserting documents into timeseries buckets. If we can find a bucket before having to normalize the metadata, we should not have to make the copy of the metadata into a new BSONObj as we currently are doing at the beginning of BucketCatalog::insert.

To be able to handle all the different shapes of incoming metadata (missing, scalars or subobjects). We need to change how it is stored inside BucketMetadata to be just the value buffer of the metadata BSONElement owned or unowned.

If we need to store the BucketMetadata (creating new bucket etc) we need to copy and take ownership of the buffer.



 Comments   
Comment by Githook User [ 03/May/21 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'danielzhangyh@gmail.com', 'username': 'YuhongZhang98'}

Message: SERVER-56441 Avoid allocate and copy metadata if we successfully lookup existing bucket
Branch: master
https://github.com/mongodb/mongo/commit/f96326be159b4dda099fcf445ededb6ccaf95f6c

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