summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp8
-rw-r--r--src/mongo/s/catalog/sharding_catalog_manager_shard_operations.cpp9
2 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp b/src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp
index 26252704de0..4c2e0e6e61b 100644
--- a/src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp
@@ -583,12 +583,12 @@ TEST_F(AddShardTest, AddMongosAsShard) {
ShardingCatalogManager::get(operationContext())
->addShard(
operationContext(), &expectedShardName, ConnectionString(shardTarget), 100);
- ASSERT_EQUALS(ErrorCodes::RPCProtocolNegotiationFailed, status);
+ ASSERT_EQUALS(ErrorCodes::IllegalOperation, status);
});
- Status rpcProtocolNegFailedStatus =
- Status(ErrorCodes::RPCProtocolNegotiationFailed, "Unable to communicate");
- expectIsMaster(shardTarget, rpcProtocolNegFailedStatus);
+ expectIsMaster(shardTarget,
+ BSON("msg"
+ << "isdbgrid"));
future.timed_get(kLongFutureTimeout);
}
diff --git a/src/mongo/s/catalog/sharding_catalog_manager_shard_operations.cpp b/src/mongo/s/catalog/sharding_catalog_manager_shard_operations.cpp
index b8ce6b79995..22f9df340c9 100644
--- a/src/mongo/s/catalog/sharding_catalog_manager_shard_operations.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_manager_shard_operations.cpp
@@ -339,9 +339,12 @@ StatusWith<ShardType> ShardingCatalogManager::_validateHostAsShard(
<< " as a shard: "
<< status.reason());
}
- if (serverGlobalParams.featureCompatibility.version.load() !=
- ServerGlobalParams::FeatureCompatibility::Version::k34 &&
- maxWireVersion < WireVersion::LATEST_WIRE_VERSION) {
+ if ((serverGlobalParams.featureCompatibility.version.load() ==
+ ServerGlobalParams::FeatureCompatibility::Version::k36 &&
+ maxWireVersion < WireVersion::LATEST_WIRE_VERSION) ||
+ (serverGlobalParams.featureCompatibility.version.load() ==
+ ServerGlobalParams::FeatureCompatibility::Version::k34 &&
+ maxWireVersion < WireVersion::LATEST_WIRE_VERSION - 1)) {
return {ErrorCodes::IncompatibleServerVersion,
str::stream() << "Cannot add " << connectionString.toString()
<< " as a shard because its binary version is not compatible with "