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

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

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • QE 2023-05-15, QE 2023-05-29, QE 2023-06-12, QE 2023-06-26, QE 2023-07-10, QE 2023-07-24, QE 2023-08-07, QE 2023-08-21, QE 2023-09-04, QE 2023-09-18, QE 2023-10-02, QE 2023-10-16, QE 2023-10-30

      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

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: