Here: https://github.com/mongodb/mongo/blob/c617c3efabb7ee6da6ec66fe9f585dfaeed631df/src/mongo/db/commands/feature_compatibility_version.cpp#L327-L332 we have:
// Update the featureCompatibilityVersion document stored in the "admin.system.version"
|
// collection.
|
BSONObj updateResult;
|
client.runCommand(nss.db().toString(), updateCmd.obj(), updateResult);
|
uassertStatusOK(getStatusFromCommandResult(updateResult));
|
uassertStatusOK(getWriteConcernStatusFromCommandResult(updateResult));
|
Since this is doing an update, it can return a status like the following with ok:1 but a write error indicating that we should fail:
{ n: 0, nModified: 0, writeErrors: [ { index: 0, code: 62, errmsg: "Must be in primary or secondary state to downgrade feature compatibility version document { _id: "featureCompatibilityVersion", version: "3.4", targetV..." } ], ok: 1.0 }
|