diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2017-02-10 16:02:05 -0500 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2017-02-27 16:04:18 -0500 |
commit | dfd92d5109d2fad504b038a133590ae9ebe560ba (patch) | |
tree | 8d963c98d2eaf5c015f81f3ec3dcd95ccc919a55 | |
parent | 21c2b106d16d69590d46b02cf252bae8ed055b3d (diff) | |
download | mongo-dfd92d5109d2fad504b038a133590ae9ebe560ba.tar.gz |
SERVER-27977 Remove unused config conn string command parameters
-rw-r--r-- | src/mongo/db/s/balancer/migration_manager.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/s/start_chunk_clone_request.cpp | 19 | ||||
-rw-r--r-- | src/mongo/db/s/start_chunk_clone_request.h | 10 | ||||
-rw-r--r-- | src/mongo/db/s/start_chunk_clone_request_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp | 29 | ||||
-rw-r--r-- | src/mongo/s/catalog/sharding_catalog_manager_shard_operations_impl.cpp | 7 | ||||
-rw-r--r-- | src/mongo/s/client/shard_local.cpp | 3 | ||||
-rw-r--r-- | src/mongo/s/client/shard_registry.h | 7 | ||||
-rw-r--r-- | src/mongo/s/move_chunk_request.cpp | 19 | ||||
-rw-r--r-- | src/mongo/s/move_chunk_request.h | 9 | ||||
-rw-r--r-- | src/mongo/s/move_chunk_request_test.cpp | 1 | ||||
-rw-r--r-- | src/mongo/s/set_shard_version_request.cpp | 14 | ||||
-rw-r--r-- | src/mongo/s/set_shard_version_request.h | 5 | ||||
-rw-r--r-- | src/mongo/s/set_shard_version_request_test.cpp | 39 | ||||
-rw-r--r-- | src/mongo/s/shard_util.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/sharding_test_fixture.cpp | 2 |
17 files changed, 34 insertions, 139 deletions
diff --git a/src/mongo/db/s/balancer/migration_manager.cpp b/src/mongo/db/s/balancer/migration_manager.cpp index 12db14105e7..a7670ce624e 100644 --- a/src/mongo/db/s/balancer/migration_manager.cpp +++ b/src/mongo/db/s/balancer/migration_manager.cpp @@ -38,6 +38,8 @@ #include "mongo/bson/util/bson_extract.h" #include "mongo/client/remote_command_targeter.h" #include "mongo/db/client.h" +#include "mongo/db/repl/replica_set_config.h" +#include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/s/balancer/scoped_migration_request.h" #include "mongo/db/s/balancer/type_migration.h" #include "mongo/executor/task_executor_pool.h" @@ -442,7 +444,7 @@ shared_ptr<Notification<RemoteCommandResponse>> MigrationManager::_schedule( &builder, nss, migrateInfo.version, - Grid::get(txn)->shardRegistry()->getConfigServerConnectionString(), + repl::ReplicationCoordinator::get(txn)->getConfig().getConnectionString(), migrateInfo.from, migrateInfo.to, ChunkRange(migrateInfo.minKey, migrateInfo.maxKey), diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp index 739e7f886e7..ac6b513a049 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp @@ -197,7 +197,6 @@ Status MigrationChunkClonerSourceLegacy::startClone(OperationContext* txn) { StartChunkCloneRequest::appendAsCommand(&cmdBuilder, _args.getNss(), _sessionId, - _args.getConfigServerCS(), _donorConnStr, _args.getFromShardId(), _args.getToShardId(), diff --git a/src/mongo/db/s/start_chunk_clone_request.cpp b/src/mongo/db/s/start_chunk_clone_request.cpp index 757a818f66f..a95616f3da6 100644 --- a/src/mongo/db/s/start_chunk_clone_request.cpp +++ b/src/mongo/db/s/start_chunk_clone_request.cpp @@ -38,7 +38,6 @@ namespace mongo { namespace { const char kRecvChunkStart[] = "_recvChunkStart"; -const char kConfigServerConnectionString[] = "configdb"; const char kFromShardConnectionString[] = "from"; const char kFromShardId[] = "fromShardName"; const char kToShardId[] = "toShardName"; @@ -72,22 +71,6 @@ StatusWith<StartChunkCloneRequest> StartChunkCloneRequest::createFromCommand(Nam std::move(secondaryThrottleStatus.getValue())); { - std::string configServerConnectionString; - Status status = bsonExtractStringField( - obj, kConfigServerConnectionString, &configServerConnectionString); - if (!status.isOK()) { - return status; - } - - auto statusConfigServerCS = ConnectionString::parse(configServerConnectionString); - if (!statusConfigServerCS.isOK()) { - return statusConfigServerCS.getStatus(); - } - - request._configServerCS = std::move(statusConfigServerCS.getValue()); - } - - { std::string fromShardConnectionString; Status status = bsonExtractStringField(obj, kFromShardConnectionString, &fromShardConnectionString); @@ -170,7 +153,6 @@ void StartChunkCloneRequest::appendAsCommand( BSONObjBuilder* builder, const NamespaceString& nss, const MigrationSessionId& sessionId, - const ConnectionString& configServerConnectionString, const ConnectionString& fromShardConnectionString, const ShardId& fromShardId, const ShardId& toShardId, @@ -184,7 +166,6 @@ void StartChunkCloneRequest::appendAsCommand( builder->append(kRecvChunkStart, nss.ns()); sessionId.append(builder); - builder->append(kConfigServerConnectionString, configServerConnectionString.toString()); builder->append(kFromShardConnectionString, fromShardConnectionString.toString()); builder->append(kFromShardId, fromShardId.toString()); builder->append(kToShardId, toShardId.toString()); diff --git a/src/mongo/db/s/start_chunk_clone_request.h b/src/mongo/db/s/start_chunk_clone_request.h index 12533f287f6..8b21a664243 100644 --- a/src/mongo/db/s/start_chunk_clone_request.h +++ b/src/mongo/db/s/start_chunk_clone_request.h @@ -61,7 +61,6 @@ public: static void appendAsCommand(BSONObjBuilder* builder, const NamespaceString& nss, const MigrationSessionId& sessionId, - const ConnectionString& configServerConnectionString, const ConnectionString& fromShardConnectionString, const ShardId& fromShardId, const ShardId& toShardId, @@ -78,10 +77,6 @@ public: return _sessionId; } - const ConnectionString& getConfigServerCS() const { - return _configServerCS; - } - const ConnectionString& getFromShardConnectionString() const { return _fromShardCS; } @@ -121,11 +116,6 @@ private: // The session id of this migration MigrationSessionId _sessionId; - // Connections string for the config server. This is a legacy field and is used in order to - // initialize the sharding state on the donor shard in case it doesn't yet know that it is part - // of a sharded system. - ConnectionString _configServerCS; - // The source host and port ConnectionString _fromShardCS; diff --git a/src/mongo/db/s/start_chunk_clone_request_test.cpp b/src/mongo/db/s/start_chunk_clone_request_test.cpp index 92b797ec9cd..f6f9a5ca972 100644 --- a/src/mongo/db/s/start_chunk_clone_request_test.cpp +++ b/src/mongo/db/s/start_chunk_clone_request_test.cpp @@ -50,7 +50,6 @@ TEST(StartChunkCloneRequest, CreateAsCommandComplete) { &builder, NamespaceString("TestDB.TestColl"), sessionId, - assertGet(ConnectionString::parse("TestConfigRS/CS1:12345,CS2:12345,CS3:12345")), assertGet(ConnectionString::parse("TestDonorRS/Donor1:12345,Donor2:12345,Donor3:12345")), ShardId("shard0001"), ShardId("shard0002"), @@ -67,7 +66,6 @@ TEST(StartChunkCloneRequest, CreateAsCommandComplete) { ASSERT_EQ("TestDB.TestColl", request.getNss().ns()); ASSERT_EQ(sessionId.toString(), request.getSessionId().toString()); ASSERT(sessionId.matches(request.getSessionId())); - ASSERT_EQ("TestConfigRS/CS1:12345,CS2:12345,CS3:12345", request.getConfigServerCS().toString()); ASSERT_EQ( assertGet(ConnectionString::parse("TestDonorRS/Donor1:12345,Donor2:12345,Donor3:12345")) .toString(), 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 d65c8ef1590..338b9842812 100644 --- a/src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp +++ b/src/mongo/s/catalog/sharding_catalog_add_shard_test.cpp @@ -326,20 +326,21 @@ TEST_F(AddShardTest, CreateShardIdentityUpsertForAddShard) { BSONObj expectedBSON = BSON("update" << "system.version" << "updates" - << BSON_ARRAY(BSON( - "q" - << BSON("_id" - << "shardIdentity" - << "shardName" - << shardName - << "clusterId" - << _clusterId) - << "u" - << BSON("$set" << BSON( - "configsvrConnectionString" - << getConfigShard()->getConnString().toString())) - << "upsert" - << true)) + << BSON_ARRAY( + BSON("q" << BSON("_id" + << "shardIdentity" + << "shardName" + << shardName + << "clusterId" + << _clusterId) + << "u" + << BSON("$set" << BSON("configsvrConnectionString" + << replicationCoordinator() + ->getConfig() + .getConnectionString() + .toString())) + << "upsert" + << true)) << "writeConcern" << BSON("w" << "majority" diff --git a/src/mongo/s/catalog/sharding_catalog_manager_shard_operations_impl.cpp b/src/mongo/s/catalog/sharding_catalog_manager_shard_operations_impl.cpp index 138da223f76..5c466e2ecf4 100644 --- a/src/mongo/s/catalog/sharding_catalog_manager_shard_operations_impl.cpp +++ b/src/mongo/s/catalog/sharding_catalog_manager_shard_operations_impl.cpp @@ -48,6 +48,8 @@ #include "mongo/db/namespace_string.h" #include "mongo/db/operation_context.h" #include "mongo/db/repl/repl_client_info.h" +#include "mongo/db/repl/replica_set_config.h" +#include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/s/type_shard_identity.h" #include "mongo/db/wire_version.h" #include "mongo/executor/task_executor.h" @@ -717,8 +719,9 @@ BSONObj ShardingCatalogManagerImpl::createShardIdentityUpsertForAddShard( BSONObjBuilder update; { BSONObjBuilder set(update.subobjStart("$set")); - set.append(ShardIdentityType::configsvrConnString(), - Grid::get(txn)->shardRegistry()->getConfigServerConnectionString().toString()); + set.append( + ShardIdentityType::configsvrConnString(), + repl::ReplicationCoordinator::get(txn)->getConfig().getConnectionString().toString()); } updateDoc->setUpdateExpr(update.obj()); updateDoc->setUpsert(true); diff --git a/src/mongo/s/client/shard_local.cpp b/src/mongo/s/client/shard_local.cpp index 270fa03a25d..dfdffe14b9f 100644 --- a/src/mongo/s/client/shard_local.cpp +++ b/src/mongo/s/client/shard_local.cpp @@ -52,8 +52,7 @@ namespace mongo { ShardLocal::ShardLocal(const ShardId& id) : Shard(id) {} const ConnectionString ShardLocal::getConnString() const { - auto replCoord = repl::getGlobalReplicationCoordinator(); - return replCoord->getConfig().getConnectionString(); + MONGO_UNREACHABLE; } std::shared_ptr<RemoteCommandTargeter> ShardLocal::getTargeter() const { diff --git a/src/mongo/s/client/shard_registry.h b/src/mongo/s/client/shard_registry.h index eff89ebe17f..374329aad7d 100644 --- a/src/mongo/s/client/shard_registry.h +++ b/src/mongo/s/client/shard_registry.h @@ -154,6 +154,13 @@ public: */ void startup(); + /** + * This is invalid to use on the config server and will hit an invariant if it is done. + * If the config server has need of a connection string for itself, it should get it from the + * replication state. + * + * Returns the connection string for the config server. + */ ConnectionString getConfigServerConnectionString() const; /** diff --git a/src/mongo/s/move_chunk_request.cpp b/src/mongo/s/move_chunk_request.cpp index 40e342a7d77..10750be5b49 100644 --- a/src/mongo/s/move_chunk_request.cpp +++ b/src/mongo/s/move_chunk_request.cpp @@ -73,22 +73,6 @@ StatusWith<MoveChunkRequest> MoveChunkRequest::createFromCommand(NamespaceString std::move(secondaryThrottleStatus.getValue())); { - std::string configServerConnectionString; - Status status = bsonExtractStringField( - obj, kConfigServerConnectionString, &configServerConnectionString); - if (!status.isOK()) { - return status; - } - - auto statusConfigServerCS = ConnectionString::parse(configServerConnectionString); - if (!statusConfigServerCS.isOK()) { - return statusConfigServerCS.getStatus(); - } - - request._configServerCS = std::move(statusConfigServerCS.getValue()); - } - - { std::string shardStr; Status status = bsonExtractStringField(obj, kFromShardId, &shardStr); request._fromShardId = shardStr; @@ -161,6 +145,7 @@ void MoveChunkRequest::appendAsCommand(BSONObjBuilder* builder, builder->append(kMoveChunk, nss.ns()); chunkVersion.appendForCommands(builder); // 3.4 shard compatibility builder->append(kEpoch, chunkVersion.epoch()); + // config connection string is included for 3.4 shard compatibility builder->append(kConfigServerConnectionString, configServerConnectionString.toString()); builder->append(kFromShardId, fromShardId.toString()); builder->append(kToShardId, toShardId.toString()); @@ -174,8 +159,6 @@ void MoveChunkRequest::appendAsCommand(BSONObjBuilder* builder, bool MoveChunkRequest::operator==(const MoveChunkRequest& other) const { if (_nss != other._nss) return false; - if (_configServerCS != other._configServerCS) - return false; if (_fromShardId != other._fromShardId) return false; if (_toShardId != other._toShardId) diff --git a/src/mongo/s/move_chunk_request.h b/src/mongo/s/move_chunk_request.h index 196f09b8489..eb58f971675 100644 --- a/src/mongo/s/move_chunk_request.h +++ b/src/mongo/s/move_chunk_request.h @@ -78,10 +78,6 @@ public: return _nss; } - const ConnectionString& getConfigServerCS() const { - return _configServerCS; - } - const ShardId& getFromShardId() const { return _fromShardId; } @@ -134,11 +130,6 @@ private: // The collection for which this request applies NamespaceString _nss; - // Connections string for the config server. This is a legacy field and is used in order to - // initialize the sharding state on the donor shard in case it doesn't yet know that it is part - // of a sharded system. - ConnectionString _configServerCS; - // The source shard id ShardId _fromShardId; diff --git a/src/mongo/s/move_chunk_request_test.cpp b/src/mongo/s/move_chunk_request_test.cpp index 8385cd93ac6..5b51e720934 100644 --- a/src/mongo/s/move_chunk_request_test.cpp +++ b/src/mongo/s/move_chunk_request_test.cpp @@ -72,7 +72,6 @@ TEST(MoveChunkRequest, Roundtrip) { auto request = assertGet( MoveChunkRequest::createFromCommand(NamespaceString(cmdObj["moveChunk"].String()), cmdObj)); ASSERT_EQ(kNs, request.getNss().ns()); - ASSERT_EQ(kTestConfigServerConnectionString.toString(), request.getConfigServerCS().toString()); ASSERT_EQ(kFromShard, request.getFromShardId()); ASSERT_EQ(kToShard, request.getToShardId()); ASSERT_BSONOBJ_EQ(kMin, request.getMinKey()); diff --git a/src/mongo/s/set_shard_version_request.cpp b/src/mongo/s/set_shard_version_request.cpp index 267bf91eb98..d98cd14f606 100644 --- a/src/mongo/s/set_shard_version_request.cpp +++ b/src/mongo/s/set_shard_version_request.cpp @@ -112,19 +112,6 @@ StatusWith<SetShardVersionRequest> SetShardVersionRequest::parseFromBSON(const B SetShardVersionRequest request; { - std::string configServer; - Status status = bsonExtractStringField(cmdObj, kConfigServer, &configServer); - if (!status.isOK()) - return status; - - auto configServerStatus = ConnectionString::parse(configServer); - if (!configServerStatus.isOK()) - return configServerStatus.getStatus(); - - request._configServer = std::move(configServerStatus.getValue()); - } - - { std::string shardName; Status status = bsonExtractStringField(cmdObj, kShardName, &shardName); request._shardName = ShardId(shardName); @@ -205,6 +192,7 @@ BSONObj SetShardVersionRequest::toBSON() const { cmdBuilder.append(kCmdName, _init ? "" : _nss.get().ns()); cmdBuilder.append(kInit, _init); cmdBuilder.append(kAuthoritative, _isAuthoritative); + // 'configdb' field is only included for v3.4 backwards compatibility cmdBuilder.append(kConfigServer, _configServer.toString()); cmdBuilder.append(kShardName, _shardName.toString()); cmdBuilder.append(kShardConnectionString, _shardCS.toString()); diff --git a/src/mongo/s/set_shard_version_request.h b/src/mongo/s/set_shard_version_request.h index 7f6374d17d0..0fb5a149d93 100644 --- a/src/mongo/s/set_shard_version_request.h +++ b/src/mongo/s/set_shard_version_request.h @@ -118,10 +118,6 @@ public: return _isAuthoritative; } - const ConnectionString& getConfigServer() const { - return _configServer; - } - const ShardId& getShardName() const { return _shardName; } @@ -168,6 +164,7 @@ private: bool _isAuthoritative{false}; bool _noConnectionVersioning{false}; + // Only required for v3.4 backwards compatibility. ConnectionString _configServer; ShardId _shardName; diff --git a/src/mongo/s/set_shard_version_request_test.cpp b/src/mongo/s/set_shard_version_request_test.cpp index 7e209414765..6e44c1f4ba3 100644 --- a/src/mongo/s/set_shard_version_request_test.cpp +++ b/src/mongo/s/set_shard_version_request_test.cpp @@ -51,8 +51,6 @@ TEST(SetShardVersionRequest, ParseInitMissingAuthoritative) { << "" << "init" << true - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -61,7 +59,6 @@ TEST(SetShardVersionRequest, ParseInitMissingAuthoritative) { ASSERT(request.isInit()); ASSERT(!request.isAuthoritative()); ASSERT(!request.getNoConnectionVersioning()); - ASSERT_EQ(request.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(request.getShardName(), "TestShard"); ASSERT_EQ(request.getShardConnectionString().toString(), shardCS.toString()); } @@ -74,8 +71,6 @@ TEST(SetShardVersionRequest, ParseInitWithAuthoritative) { << true << "authoritative" << true - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -84,7 +79,6 @@ TEST(SetShardVersionRequest, ParseInitWithAuthoritative) { ASSERT(request.isInit()); ASSERT(request.isAuthoritative()); ASSERT(!request.getNoConnectionVersioning()); - ASSERT_EQ(request.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(request.getShardName(), "TestShard"); ASSERT_EQ(request.getShardConnectionString().toString(), shardCS.toString()); } @@ -97,8 +91,6 @@ TEST(SetShardVersionRequest, ParseInitNoConnectionVersioning) { << true << "authoritative" << true - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -109,7 +101,6 @@ TEST(SetShardVersionRequest, ParseInitNoConnectionVersioning) { ASSERT(request.isInit()); ASSERT(request.isAuthoritative()); ASSERT(request.getNoConnectionVersioning()); - ASSERT_EQ(request.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(request.getShardName(), "TestShard"); ASSERT_EQ(request.getShardConnectionString().toString(), shardCS.toString()); } @@ -120,8 +111,6 @@ TEST(SetShardVersionRequest, ParseFull) { SetShardVersionRequest request = assertGet(SetShardVersionRequest::parseFromBSON(BSON("setShardVersion" << "db.coll" - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -134,7 +123,6 @@ TEST(SetShardVersionRequest, ParseFull) { ASSERT(!request.isInit()); ASSERT(!request.isAuthoritative()); ASSERT(!request.getNoConnectionVersioning()); - ASSERT_EQ(request.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(request.getShardName(), "TestShard"); ASSERT_EQ(request.getShardConnectionString().toString(), shardCS.toString()); ASSERT_EQ(request.getNS().toString(), "db.coll"); @@ -149,8 +137,6 @@ TEST(SetShardVersionRequest, ParseFullWithAuthoritative) { SetShardVersionRequest request = assertGet(SetShardVersionRequest::parseFromBSON(BSON("setShardVersion" << "db.coll" - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -165,7 +151,6 @@ TEST(SetShardVersionRequest, ParseFullWithAuthoritative) { ASSERT(!request.isInit()); ASSERT(request.isAuthoritative()); ASSERT(!request.getNoConnectionVersioning()); - ASSERT_EQ(request.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(request.getShardName(), "TestShard"); ASSERT_EQ(request.getShardConnectionString().toString(), shardCS.toString()); ASSERT_EQ(request.getNS().toString(), "db.coll"); @@ -180,8 +165,6 @@ TEST(SetShardVersionRequest, ParseFullNoConnectionVersioning) { SetShardVersionRequest request = assertGet(SetShardVersionRequest::parseFromBSON(BSON("setShardVersion" << "db.coll" - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -196,7 +179,6 @@ TEST(SetShardVersionRequest, ParseFullNoConnectionVersioning) { ASSERT(!request.isInit()); ASSERT(!request.isAuthoritative()); ASSERT(request.getNoConnectionVersioning()); - ASSERT_EQ(request.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(request.getShardName(), "TestShard"); ASSERT_EQ(request.getShardConnectionString().toString(), shardCS.toString()); ASSERT_EQ(request.getNS().toString(), "db.coll"); @@ -205,26 +187,11 @@ TEST(SetShardVersionRequest, ParseFullNoConnectionVersioning) { ASSERT_EQ(request.getNSVersion().epoch(), chunkVersion.epoch()); } -TEST(SetShardVersionRequest, ParseInitNoConfigServer) { - auto ssvStatus = SetShardVersionRequest::parseFromBSON(BSON("setShardVersion" - << "" - << "init" - << true - << "shard" - << "TestShard" - << "shardHost" - << shardCS.toString())); - - ASSERT_EQ(ErrorCodes::NoSuchKey, ssvStatus.getStatus().code()); -} - TEST(SetShardVersionRequest, ParseFullNoNS) { const ChunkVersion chunkVersion(1, 2, OID::gen()); auto ssvStatus = SetShardVersionRequest::parseFromBSON(BSON("setShardVersion" << "" - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -242,8 +209,6 @@ TEST(SetShardVersionRequest, ParseFullNSContainsDBOnly) { auto ssvStatus = SetShardVersionRequest::parseFromBSON(BSON("setShardVersion" << "dbOnly" - << "configdb" - << configCS.toString() << "shard" << "TestShard" << "shardHost" @@ -263,7 +228,6 @@ TEST(SetShardVersionRequest, ToSSVCommandInit) { ASSERT(ssv.isInit()); ASSERT(ssv.isAuthoritative()); ASSERT(!ssv.getNoConnectionVersioning()); - ASSERT_EQ(ssv.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(ssv.getShardName(), "TestShard"); ASSERT_EQ(ssv.getShardConnectionString().toString(), shardCS.toString()); @@ -293,7 +257,6 @@ TEST(SetShardVersionRequest, ToSSVCommandFull) { ASSERT(!ssv.isInit()); ASSERT(!ssv.isAuthoritative()); ASSERT(!ssv.getNoConnectionVersioning()); - ASSERT_EQ(ssv.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(ssv.getShardName(), "TestShard"); ASSERT_EQ(ssv.getShardConnectionString().toString(), shardCS.toString()); ASSERT_EQ(ssv.getNS().ns(), "db.coll"); @@ -328,7 +291,6 @@ TEST(SetShardVersionRequest, ToSSVCommandFullAuthoritative) { ASSERT(!ssv.isInit()); ASSERT(ssv.isAuthoritative()); ASSERT(!ssv.getNoConnectionVersioning()); - ASSERT_EQ(ssv.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(ssv.getShardName(), "TestShard"); ASSERT_EQ(ssv.getShardConnectionString().toString(), shardCS.toString()); ASSERT_EQ(ssv.getNS().ns(), "db.coll"); @@ -363,7 +325,6 @@ TEST(SetShardVersionRequest, ToSSVCommandFullNoConnectionVersioning) { ASSERT(!ssv.isInit()); ASSERT(ssv.isAuthoritative()); ASSERT(ssv.getNoConnectionVersioning()); - ASSERT_EQ(ssv.getConfigServer().toString(), configCS.toString()); ASSERT_EQ(ssv.getShardName(), "TestShard"); ASSERT_EQ(ssv.getShardConnectionString().toString(), shardCS.toString()); ASSERT_EQ(ssv.getNS().ns(), "db.coll"); diff --git a/src/mongo/s/shard_util.cpp b/src/mongo/s/shard_util.cpp index db17c15d5db..b38fd9657e7 100644 --- a/src/mongo/s/shard_util.cpp +++ b/src/mongo/s/shard_util.cpp @@ -165,8 +165,6 @@ StatusWith<boost::optional<ChunkRange>> splitChunkAtMultiplePoints( BSONObjBuilder cmd; cmd.append("splitChunk", nss.ns()); - cmd.append("configdb", - Grid::get(txn)->shardRegistry()->getConfigServerConnectionString().toString()); cmd.append("from", shardId.toString()); cmd.append("keyPattern", shardKeyPattern.toBSON()); collectionVersion.appendForCommands(&cmd); diff --git a/src/mongo/s/sharding_test_fixture.cpp b/src/mongo/s/sharding_test_fixture.cpp index c1bf99c59e8..59d3762925f 100644 --- a/src/mongo/s/sharding_test_fixture.cpp +++ b/src/mongo/s/sharding_test_fixture.cpp @@ -461,8 +461,6 @@ void ShardingTestFixture::expectSetShardVersion(const HostAndPort& expectedHost, ASSERT(!ssv.isInit()); ASSERT(ssv.isAuthoritative()); - ASSERT_EQ(shardRegistry()->getConfigServerConnectionString().toString(), - ssv.getConfigServer().toString()); ASSERT_EQ(expectedShard.getHost(), ssv.getShardConnectionString().toString()); ASSERT_EQ(expectedNs.toString(), ssv.getNS().ns()); ASSERT_EQ(expectedChunkVersion.toString(), ssv.getNSVersion().toString()); |