summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-08-01 13:12:57 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-08-02 13:13:00 -0400
commitaee1a8d71d0b7c6c806e9790cb1310c94f36090a (patch)
tree4194b45c11dbd2cb09cf04baed403a75586af9cb /jstests
parentff6265e301c01a15eddf442e627a854a469f7659 (diff)
downloadmongo-aee1a8d71d0b7c6c806e9790cb1310c94f36090a.tar.gz
SERVER-36119 Explicitly downgrade new shard's FCV in the mixed version convert_to_and_from_sharded.js
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/convert_to_and_from_sharded.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/jstests/sharding/convert_to_and_from_sharded.js b/jstests/sharding/convert_to_and_from_sharded.js
index 08024a64104..f6f9abaed2f 100644
--- a/jstests/sharding/convert_to_and_from_sharded.js
+++ b/jstests/sharding/convert_to_and_from_sharded.js
@@ -4,9 +4,10 @@
* @tags: [requires_persistence]
*/
(function() {
-
"use strict";
+ load("jstests/libs/feature_compatibility_version.js");
+
var NUM_NODES = 3;
/**
@@ -35,6 +36,18 @@
var priConn = replShard.getPrimary();
+ // Initialized replica sets with data on them will report themselves as the latest FCV of the
+ // binary that they are running. This poses a problem when this test is run in the mixed version
+ // suite because mongos will be 'last-stable', but if this node is started with the latest
+ // binaries, it will report itself as the 'latest' FCV, which would cause mongos to refuse to
+ // connect to it and shutdown.
+ //
+ // In order to work around this, in the mixed version suite, be pessimistic and always set this
+ // node to the 'last-stable' FCV
+ if (jsTestOptions().shardMixedBinVersions) {
+ assert.commandWorked(priConn.adminCommand({setFeatureCompatibilityVersion: lastStableFCV}));
+ }
+
assert.writeOK(priConn.getDB('test').unsharded.insert({_id: 'marker'}));
checkBasicCRUD(priConn.getDB('test').unsharded);
@@ -112,5 +125,4 @@
checkBasicCRUD(priConn.getDB('test').sharded);
replShard.stopSet();
-
})();