-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Labels:None
-
Fully Compatible
-
Repl 2021-02-08
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