-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
Execution Team 2021-05-03, Execution Team 2021-05-17
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.