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

Generate generic argument and reply fields as c++ structures

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Service Arch 2022-11-28, Service Arch 2022-12-12
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/mongo/blob/master/src/mongo/idl/generic_argument.idl Lists generic argument fields that may be present in all command BSON, and generic reply fields that all command reply BSON may contain.

      Today, these lists are special one-off IDL types that are used to generate lookup tables that allow the IDL marshalling and demarshalling code to ignore these fields. This means that there are no C++ representations of these generic argument/reply fields, and all code that wants to append such fields to a command or parse them from a reply must operate on BSON directly. 

      To allow a command-invoking API to use well-structured types instead of BSON to represent commands and replies, we'll need to also have a type that represents the generic fields we want to attach to the command and a type that represents the generic fields present in the reply. Let's teach the IDL compiler to generate C++ structures for these generic argument and reply fields.

      Acceptance criteria: 

      Generate C++ structures with setters and getters for the generic argument fields and generic reply fields. For now, allow these fields to be of any type. Maintain the existing C++ public API for these fields - i.e. provide a way for code to lookup if a field is a generic argument or reply field, and the forward_{to,from}_shards value of that field. 

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen (Inactive)
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: