summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-10-03 00:02:43 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-10-03 00:05:51 -0400
commitf50acb128dc0485b48d8045587579ba48ae888b4 (patch)
tree1ff5514dc9e8f091bccf28907c50d34bfd36f2c7
parent0391c457ac6ff41f6696a796ebc6d5d7809375c0 (diff)
downloadmongo-f50acb128dc0485b48d8045587579ba48ae888b4.tar.gz
SERVER-25623 fix config_server_catalog_test unit test
-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 "