diff options
author | Robert Guo <robert.guo@mongodb.com> | 2021-10-04 20:44:12 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-04 21:28:32 +0000 |
commit | c8728b8156b3c1ede8b629f4ba2a0a1fd84231b3 (patch) | |
tree | fb2156d8186c59165669582e8bbd635f8496c8be /src | |
parent | 03954089313c9c35c2dd9b426acf97c225839d36 (diff) | |
download | mongo-c8728b8156b3c1ede8b629f4ba2a0a1fd84231b3.tar.gz |
SERVER-58831 standardize shardingtest multiversion version
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/shell/replsettest.js | 11 | ||||
-rw-r--r-- | src/mongo/shell/shardingtest.js | 20 |
2 files changed, 15 insertions, 16 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index 9557422a43e..78d9d456b88 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -1416,7 +1416,6 @@ var ReplSetTest = function(opts) { // Set the FCV to 'last-lts'/'last-continuous' if we are running a mixed version replica // set. If this is a config server, the FCV will be set as part of ShardingTest. - // TODO SERVER-50389: Set FCV to 'last-continuous' properly when last-continuous binary // versions are supported with the useRandomBinVersionsWithinReplicaSet option. let setLastLTSFCV = (lastLTSBinVersionWasSpecifiedForSomeNode || jsTest.options().useRandomBinVersionsWithinReplicaSet) && @@ -1444,8 +1443,9 @@ var ReplSetTest = function(opts) { // The server has a practice of adding a reconfig as part of upgrade/downgrade logic // in the setFeatureCompatibilityVersion command. - print("Fetch the config version from primary since last-lts downgrade might " + - "perform a reconfig."); + print( + "Fetch the config version from primary since last-lts or last-continuous downgrade might " + + "perform a reconfig."); config.version = self.getReplSetConfigFromNode().version; }); } @@ -2788,9 +2788,8 @@ var ReplSetTest = function(opts) { options.binVersion = "latest"; } else { const rand = Random.rand(); - // TODO SERVER-50389: Support last-continuous binary version with - // useRandomBinVersionsWithinReplicaSet. - options.binVersion = rand < 0.5 ? "latest" : "last-continuous"; + options.binVersion = + rand < 0.5 ? "latest" : jsTest.options().useRandomBinVersionsWithinReplicaSet; } print("Randomly assigned binary version: " + options.binVersion + " to node: " + n); } diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js index cdd7018be6e..b044b9e19ff 100644 --- a/src/mongo/shell/shardingtest.js +++ b/src/mongo/shell/shardingtest.js @@ -971,12 +971,13 @@ var ShardingTest = function(params) { // Must check shardMixedBinVersion because it causes shardOptions.binVersion to be an // object (versionIterator) rather than a version string. Must check mongosBinVersion, // as well, because it does not update mongosOptions.binVersion. - // TODO SERVER-50389: Differentiate between 'last-lts' and 'last-continuous' when - // last-continuous is supported with shardMixedBinVersions. - if ((MongoRunner.areBinVersionsTheSame(binVersion, "last-continuous") && - jsTestOptions().shardMixedBinVersions) || - (jsTestOptions().mongosBinVersion && - MongoRunner.areBinVersionsTheSame(binVersion, jsTestOptions().mongosBinVersion))) { + const isMixedVersionShard = + (MongoRunner.areBinVersionsTheSame(binVersion, "last-continuous") || + MongoRunner.areBinVersionsTheSame(binVersion, "last-lts")) && + jsTestOptions().shardMixedBinVersions; + const isMixedVersionMongos = jsTestOptions().mongosBinVersion && + MongoRunner.areBinVersionsTheSame(binVersion, jsTestOptions().mongosBinVersion); + if (isMixedVersionShard || isMixedVersionMongos) { return true; } @@ -1245,13 +1246,12 @@ var ShardingTest = function(params) { // If the test doesn't depend on specific shard binVersions, create a mixed // version // shard cluster that randomly assigns shard binVersions, half "latest" and half - // "last-continuous". - // TODO SERVER-50389: Support last-continuous binary version with + // "last-continuous" or "last-lts". // shardMixedBinVersions. if (!otherParams.shardOptions.binVersion) { Random.setRandomSeed(); - otherParams.shardOptions.binVersion = - MongoRunner.versionIterator(["latest", "last-continuous"], true); + otherParams.shardOptions.binVersion = MongoRunner.versionIterator( + ["latest", jsTestOptions().shardMixedBinVersions], true); } } |