[SERVER-51590] Disable API parameter checking for FCV < 4.9 Created: 14/Oct/20  Updated: 27/Oct/23  Resolved: 14/Oct/20

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

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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.


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