[SERVER-56387] Check optionalBool-typed IDL fields for backward compatibility Created: 27/Apr/21  Updated: 29/Oct/23  Resolved: 14/Jan/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: New Feature Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Romans Kasperovics
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-55899 Move away from using Bson_serializati... Closed
is related to SERVER-60349 Make IDL compatibility checker allow ... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Followup to the "API Version Testing" epic, and to SERVER-55899. There are circumstances in which the "optionalBool" IDL type is preferable to the "bool" type with optional: true, for example in basic_types.idl:

types:
    optionalBool:
        bson_serialization_type: any
        cpp_type: "mongo::OptionalBool"
        default: "mongo::OptionalBool()"
        deserializer: "mongo::OptionalBool::parseFromBSON"
        serializer: "mongo::OptionalBool::serializeToBSON"
structs:
    Collation:
        fields:
            backwards:
                type: optionalBool 

The bson_serialization_type for optionalBool is "any" in IDL, which disables a lot of idl_check_compatibility.py's semantic checks.

Consider promoting optionalBool from a custom-defined IDL type to a first-class IDL type with well-known semantics, and update idl_check_compatibility.py to understand this type as well as it understands the "bool" type with optional: true.

This work can be done after the Versioned API is released in 5.0. Past IDL definitions should still be valid and our backward compatibility rules will still apply, we'll just start interpreting IDL files differently when we check them.



 Comments   
Comment by Githook User [ 14/Jan/22 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-56387 Check optionalBool-typed IDL fields for backward compatibility
Branch: master
https://github.com/mongodb/mongo/commit/58f041625bc92ae6f5cbd52ba1c77bb42aacb29b

Comment by Lingzhi Deng [ 04/Oct/21 ]

Since this affects most of the commands Query owns, we are assigning this to Query for considerations. Repl doesn't have the bandwidth to do this in the near future.

Comment by A. Jesse Jiryu Davis [ 27/Apr/21 ]

Assigning to Replication for the moment since we did the original checker work.

Generated at Thu Feb 08 05:39:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.