[SERVER-71409] Generate generic argument and reply fields as c++ structures Created: 16/Nov/22  Updated: 29/Oct/23  Resolved: 30/Nov/22

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

Type: Task Priority: Major - P3
Reporter: George Wangensteen Assignee: George Wangensteen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-11-28, Service Arch 2022-12-12
Participants:

 Description   

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. 



 Comments   
Comment by Githook User [ 30/Nov/22 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-71409 Generate generic argument and reply fields as c++ structures
Branch: master
https://github.com/mongodb/mongo/commit/47895b611fd19e393295fdf991c9b400530ff880

Comment by George Wangensteen [ 17/Nov/22 ]

https://github.com/10gen/mongo/pull/8780/files

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