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

BufBuilder shouldn't be used to serialize data that isn't BSON

    XMLWordPrintableJSON

Details

    • Task
    • Status: In Progress
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None
    • QE 2023-02-06, QE 2023-02-20

    Description

      BufBuilder is hard-coded to write numbers in little endian, which is appropriate for BSON but might not be expected in other scenarios. Currently, we do use BufBuilder for serialization during spilling (and possibly in some other cases) and must explicitly specify LittleEndian as the format when deserializing with BufReader.

      The recommendation from Andrew Morrow is to use DataBuillder to serialize. This way, when write/read isn't qualified with endianness, the plalform's endianness is used, and if need to persist or transmit the data, the endianness has to be explicitly specified on both writer and reader avoiding bugs such as BF-24912

      Attachments

        Issue Links

          Activity

            People

              colin.stolley@mongodb.com Colin Stolley
              irina.yatsenko@mongodb.com Irina Yatsenko
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: