[SERVER-85254] Update Materializer Interface to provide lifetime info Created: 16/Jan/24  Updated: 07/Feb/24  Resolved: 06/Feb/24

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

Type: Task Priority: Major - P3
Reporter: Chris Wolff Assignee: Naama Bareket
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-85256 Update query system to avoid copying ... Backlog
Related
related to SERVER-86372 Avoid materializing BSONElements twic... In Progress
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The decompressor uses the materializer interface to produce elements of the desired type from compressed data. When a BSONElement is passed to the materializer, it may be an uncompressed element that appeared in the BSONColumn bytes, or it may have already been materialized in the allocator, as when an object is created from a set of interleaved streams.

If the BSONElement is from the BSONColumn bytes, then the element's data pointer may dangle when a yield happens. On the other hand, BSONElements that point to data in the allocator will have a lifetime the same as the allocator. The allocator is reference-counted and the query system will be able to ensure it has a long enough lifetime.

We should update the materializer interface so that it can choose to copy or not, depending on the context. Probably the right approach would be to add a boolean template parameter to the materialize() methods that accept a BSONElement.



 Comments   
Comment by Githook User [ 06/Feb/24 ]

Author:

{'name': 'naama-bareket', 'email': '85578126+naama-bareket@users.noreply.github.com', 'username': 'naama-bareket'}

Message: SERVER-85254: Update Materializer Interface to provide lifetime info (#18709)

GitOrigin-RevId: bc80d8e65d061fd129005caafca4f7cf498a128e
Branch: master
https://github.com/mongodb/mongo/commit/16effbcee4223141c14e26fdde3d152ac78b1091

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