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

Disable API parameter checking for FCV < 4.9

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      We implemented the apiVersion, apiStrict, and apiDeprecationErrors parameters in MongoDB 4.9 (some of the work was released in 4.7 and 4.8.)

      In MongoDB 4.4, before the server was aware of these parameters, some commands ignore them and some don't:

      > // Connected to mongod 4.4.1.
      > db.runCommand({ping: 1, apiVersion: "1"})
      { "ok" : 1 }
      > db.runCommand({insert: "collection", documents: [{}], apiVersion: "1"})
      {
              "ok" : 0,
              "errmsg" : "BSON field 'insert.apiVersion' is an unknown field.",
              "code" : 40415,
              "codeName" : "Location40415"
      }
      

      arun.banala suggests an FCV check in MongoDB 4.9+ to ignore these parameters if FCV < "4.9". Then in a mixed-version cluster with some nodes running 4.4 and some running 5.0, the API parameters will be consistently ignored until the cluster is fully upgraded to 5.0 and setFeatureCompatibility: "5.0" has succeeded.

      Alternatively we could error if apiVersion is passed and FCV < "4.9". I'm not sure what the right behavior is.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: