[SERVER-53206] Type check reply_type in IDL compatibility checker script Created: 03/Dec/20  Updated: 29/Oct/23  Resolved: 02/Feb/21

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

Type: Task Priority: Major - P3
Reporter: Samyukta Lanka Assignee: Huayu Ouyang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Repl 2021-02-08
Participants:

 Description   

We should check that the type of each field in the new command's reply type is a subset of the type of the corresponding field in the old command's reply type. This corresponds to the following pseudocode:

old_type := old_field's type
new_type := new_field's type
 
assert old_type.bson_serialization_type != "any"
assert new_type.bson_serialization_type != "any"
 
# Assert new_type ⊆ old_type.
if old_type is enum:
    assert new_type is enum
    assert new_type's values ⊆ old_type's values
elif old_type is struct:
    assert new_type is struct
else:
    assert new_type.bson_serialization_type ⊆ old_type.bson_serialization_type



 Comments   
Comment by Githook User [ 02/Feb/21 ]

Author:

{'name': 'Huayu Ouyang', 'email': 'huayu.ouyang@mongodb.com', 'username': 'huayu-ouyang'}

Message: SERVER-53206 Type check reply_type in IDL compatibility checker script
Branch: master
https://github.com/mongodb/mongo/commit/3615d707c495af3019344dc8878259ff362607d1

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