summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl/replication_info.cpp9
-rw-r--r--src/mongo/s/client/sharding_connection_hook.cpp13
-rw-r--r--src/mongo/shell/shardingtest.js10
3 files changed, 23 insertions, 9 deletions
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp
index d27257a8eb0..d655ccfa73b 100644
--- a/src/mongo/db/repl/replication_info.cpp
+++ b/src/mongo/db/repl/replication_info.cpp
@@ -279,7 +279,14 @@ public:
appendReplicationInfo(txn, result, 0);
if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
- result.append("configsvr", 1);
+ // If we have feature compatibility version 3.4, use a config server mode that 3.2
+ // mongos won't understand. This should prevent a 3.2 mongos from joining the cluster or
+ // making a connection to the config servers.
+ int configServerModeNumber = (serverGlobalParams.featureCompatibility.version.load() ==
+ ServerGlobalParams::FeatureCompatibility::Version::k34)
+ ? 2
+ : 1;
+ result.append("configsvr", configServerModeNumber);
}
result.appendNumber("maxBsonObjectSize", BSONObjMaxUserSize);
diff --git a/src/mongo/s/client/sharding_connection_hook.cpp b/src/mongo/s/client/sharding_connection_hook.cpp
index b24bccd3381..7085a290a0c 100644
--- a/src/mongo/s/client/sharding_connection_hook.cpp
+++ b/src/mongo/s/client/sharding_connection_hook.cpp
@@ -99,10 +99,17 @@ void ShardingConnectionHook::onCreate(DBClientBase* conn) {
return;
}
+ const long long minKnownConfigServerMode = 1;
+ const long long maxKnownConfigServerMode = 2;
uassert(28785,
- str::stream() << "Unrecognized configsvr version number: " << configServerModeNumber
- << ". Expected either 0 or 1",
- configServerModeNumber == 0 || configServerModeNumber == 1);
+ str::stream() << "Unrecognized configsvr mode number: " << configServerModeNumber
+ << ". Range of known configsvr mode numbers is: ["
+ << minKnownConfigServerMode
+ << ", "
+ << maxKnownConfigServerMode
+ << "]",
+ configServerModeNumber >= minKnownConfigServerMode &&
+ configServerModeNumber <= maxKnownConfigServerMode);
uassertStatusOK(status);
}
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index 0eb553ecfca..fe042cbcafa 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -1226,29 +1226,29 @@ var ShardingTest = function(params) {
*/
function shouldSetFeatureCompatibilityVersion32() {
if (otherParams.configOptions && otherParams.configOptions.binVersion &&
- otherParams.configOptions.binVersion === '3.2') {
+ MongoRunner.getBinVersionFor(otherParams.configOptions.binVersion) === '3.2') {
return false;
}
if (jsTestOptions().shardMixedBinVersions) {
return true;
}
if (otherParams.shardOptions && otherParams.shardOptions.binVersion &&
- otherParams.shardOptions.binVersion === '3.2') {
+ MongoRunner.getBinVersionFor(otherParams.shardOptions.binVersion) === '3.2') {
return true;
}
for (var i = 0; i < numShards; i++) {
if (otherParams['d' + i] && otherParams['d' + i].binVersion &&
- otherParams['d' + i].binVersion === '3.2') {
+ MongoRunner.getBinVersionFor(otherParams['d' + i].binVersion) === '3.2') {
return true;
}
}
if (otherParams.mongosOptions && otherParams.mongosOptions.binVersion &&
- otherParams.mongosOptions.binVersion === '3.2') {
+ MongoRunner.getBinVersionFor(otherParams.mongosOptions.binVersion) === '3.2') {
return true;
}
for (var i = 0; i < numMongos; i++) {
if (otherParams['s' + i] && otherParams['s' + i].binVersion &&
- otherParams['s' + i].binVersion === '3.2') {
+ MongoRunner.getBinVersionFor(otherParams['s' + i].binVersion) === '3.2') {
return true;
}
}