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

Type check reply_type in IDL compatibility checker script

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.9.0
    • None
    • Replication
    • None
    • Fully Compatible
    • Repl 2021-02-08

    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
      

      Attachments

        Activity

          People

            huayu.ouyang@mongodb.com Huayu Ouyang
            samy.lanka@mongodb.com Samyukta Lanka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: