Disallow serialization of VersionContext without Operation FCV

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: 8.3.0-rc0
    • Component/s: Upgrade/Downgrade
    • None
    • Catalog and Routing
    • Fully Compatible
    • CAR Team 2025-10-27
    • 🟩 Routing and Topology
    • None
    • None
    • None
    • None
    • None
    • None

      The VersionContext type can represent either an operation with an associated Operation FCV, or an operation without OFCV. Currently, the "Operation without OFCV" state can be serialized/deserialized to an empty BSON object. This possibility is ultimately unused, since a VersionContext-typed field can be made optional in IDL and makes for a cleaner and more efficient representation.

       

      However this lingering serialization capability is a source of bugs. The following two commands are semantically identical but have different internal representations (empty optional vs Operation without FCV) so they could behave differently:

      db.runCommand({create: "x1"})
      db.runCommand({create: "x1", versionContext: {}})

       

      Remove the possibility to serialize or deserialize a VersionContext without OFCV in order to forbid the later case.

            Assignee:
            Joan Bruguera Micó
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: