diff options
author | Maria van Keulen <maria@mongodb.com> | 2018-02-08 18:15:57 -0500 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2018-02-21 10:28:45 -0500 |
commit | 6df7ca5841e2ffa40354975323e410796d952382 (patch) | |
tree | ec090fec1d80dc979b4e8439a848d932c4a5b4e9 /jstests/noPassthroughWithMongod | |
parent | a3f077342401e97df986c66792eb099978301631 (diff) | |
download | mongo-6df7ca5841e2ffa40354975323e410796d952382.tar.gz |
SERVER-32597 Bump generic fCV references
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r-- | jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js b/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js index 2d70d7c6508..0c6fc4de768 100644 --- a/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js +++ b/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js @@ -3,34 +3,28 @@ // ensures that an older version mongod/mongos will fail to connect to the node when it is upgraded, // upgrading, or downgrading. // -// TODO: remove FCV 3.4 isMaster testing when we finally remove FCV 3.4. (SERVER-32597) (function() { "use strict"; + load('./jstests/libs/feature_compatibility_version.js'); const adminDB = db.getSiblingDB("admin"); const isMasterCommand = { isMaster: 1, internalClient: {minWireVersion: NumberInt(0), maxWireVersion: NumberInt(7)} }; - const upgradeVersion = "4.0"; - const downgradeVersion = "3.6"; - const deprecatedDowngradeVersion = "3.4"; - - // TODO: remove this setFCV when SERVER-32597 bumps the default FCV from 3.4 to 3.6. - assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: downgradeVersion})); // When the featureCompatibilityVersion is equal to the upgrade version, running isMaster with // internalClient returns minWireVersion == maxWireVersion. - assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: upgradeVersion})); + checkFCV(adminDB, latestFCV); let res = adminDB.runCommand(isMasterCommand); assert.commandWorked(res); assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); // When the featureCompatibilityVersion is upgrading, running isMaster with internalClient // returns minWireVersion == maxWireVersion. - assert.writeOK(adminDB.system.version.update( - {_id: "featureCompatibilityVersion"}, - {$set: {version: downgradeVersion, targetVersion: upgradeVersion}})); + assert.writeOK( + adminDB.system.version.update({_id: "featureCompatibilityVersion"}, + {$set: {version: lastStableFCV, targetVersion: latestFCV}})); res = adminDB.runCommand(isMasterCommand); assert.commandWorked(res); assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); @@ -39,14 +33,14 @@ // returns minWireVersion == maxWireVersion. assert.writeOK(adminDB.system.version.update( {_id: "featureCompatibilityVersion"}, - {$set: {version: downgradeVersion, targetVersion: downgradeVersion}})); + {$set: {version: lastStableFCV, targetVersion: lastStableFCV}})); res = adminDB.runCommand(isMasterCommand); assert.commandWorked(res); assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); // When the featureCompatibilityVersion is equal to the downgrade version, running isMaster with // internalClient returns minWireVersion + 1 == maxWireVersion. - assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: downgradeVersion})); + assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: lastStableFCV})); res = adminDB.runCommand(isMasterCommand); assert.commandWorked(res); assert.eq(res.minWireVersion + 1, res.maxWireVersion, tojson(res)); @@ -54,7 +48,7 @@ // When the internalClient field is missing from the isMaster command, the response returns the // full wire version range from minWireVersion == 0 to maxWireVersion == latest version, even if // the featureCompatibilityVersion is equal to the upgrade version. - assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: upgradeVersion})); + assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: latestFCV})); res = adminDB.runCommand({isMaster: 1}); assert.commandWorked(res); assert.eq(res.minWireVersion, 0, tojson(res)); @@ -62,6 +56,9 @@ // When the featureCompatibilityVersion is equal to the deprecated downgrade version, running // isMaster with internalClient returns minWireVersion + 1 == maxWireVersion. + // TODO(SERVER-33179) remove this section once fCV 3.4 is removed. + const downgradeVersion = "3.6"; + const deprecatedDowngradeVersion = "3.4"; assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: downgradeVersion})); assert.commandWorked( adminDB.runCommand({setFeatureCompatibilityVersion: deprecatedDowngradeVersion})); |