diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-01-10 17:37:50 -0500 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-01-12 08:58:34 -0500 |
commit | 6e57c0d022c15828ab8c16a1229b355e30e734b6 (patch) | |
tree | e4e6cd7ba83eaf272b77f4c867b7fda397bccb84 /jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js | |
parent | 11225541cbbaed58e27ff5254c145dd834a86190 (diff) | |
download | mongo-6e57c0d022c15828ab8c16a1229b355e30e734b6.tar.gz |
SERVER-32519 clean up WireVersion enum uses in the code to use LATEST_WIRE_VERSION
Diffstat (limited to 'jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js b/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js index 53ef53bff5b..726498f7891 100644 --- a/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js +++ b/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js @@ -1,6 +1,6 @@ // Tests that when the featureCompatibilityVersion is not equal to the downgrade version, running -// isMaster with internalClient returns a response with minWireVersion=maxWireVersion. This ensures -// that an older version mongod/mongos will fail to connect to the node when it is upgraded, +// isMaster with internalClient returns a response with minWireVersion == maxWireVersion. This +// ensures that an older version mongod/mongos will fail to connect to the node when it is upgraded, // upgrading, or downgrading. (function() { "use strict"; @@ -14,14 +14,14 @@ const downgradeVersion = "3.4"; // When the featureCompatibilityVersion is equal to the upgrade version, running isMaster with - // internalClient returns minWireVersion=maxWireVersion. + // internalClient returns minWireVersion == maxWireVersion. assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: upgradeVersion})); 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. + // returns minWireVersion == maxWireVersion. assert.writeOK(adminDB.system.version.update( {_id: "featureCompatibilityVersion"}, {$set: {version: downgradeVersion, targetVersion: upgradeVersion}})); @@ -30,7 +30,7 @@ assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); // When the featureCompatibilityVersion is downgrading, running isMaster with internalClient - // returns minWireVersion=maxWireVersion. + // returns minWireVersion == maxWireVersion. assert.writeOK(adminDB.system.version.update( {_id: "featureCompatibilityVersion"}, {$set: {version: downgradeVersion, targetVersion: downgradeVersion}})); @@ -39,17 +39,18 @@ assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); // When the featureCompatibilityVersion is equal to the downgrade version, running isMaster with - // internalClient returns minWireVersion<maxWireVersion. + // internalClient returns minWireVersion + 1 == maxWireVersion. assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: downgradeVersion})); res = adminDB.runCommand(isMasterCommand); assert.commandWorked(res); - assert.lt(res.minWireVersion, res.maxWireVersion, tojson(res)); + assert.eq(res.minWireVersion + 1, res.maxWireVersion, tojson(res)); - // When the internalClient field is missing from the isMaster command, the response has - // minWireVersion<maxWireVersion, even if the featureCompatibilityVersion is equal to the - // upgrade version. + // 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})); res = adminDB.runCommand({isMaster: 1}); assert.commandWorked(res); + assert.eq(res.minWireVersion, 0, tojson(res)); assert.lt(res.minWireVersion, res.maxWireVersion, tojson(res)); })(); |