Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-85254

Update Materializer Interface to provide lifetime info

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • None
    • None
    • None
    • Storage Execution
    • Fully Compatible

    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.

      Attachments

        Activity

          People

            naama.bareket@mongodb.com Naama Bareket
            chris.wolff@mongodb.com Chris Wolff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: