From a05ba516fb340bd7a22480303c8d647b6d6c9874 Mon Sep 17 00:00:00 2001 From: Misha Tyulenev Date: Wed, 6 Jan 2016 10:17:01 -0500 Subject: SERVER-21906 always use ReplicaSetMonitor when updating ShardRegistry lookup maps --- src/mongo/s/client/shard_registry.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mongo/s/client/shard_registry.h') diff --git a/src/mongo/s/client/shard_registry.h b/src/mongo/s/client/shard_registry.h index 6c18173505a..dec0f770803 100644 --- a/src/mongo/s/client/shard_registry.h +++ b/src/mongo/s/client/shard_registry.h @@ -150,12 +150,13 @@ public: /** * Updates _lookup and _rsLookup based on the given new version of the given Shard's - * ConnectionString. + * ConnectionString. If ConnectionString is not specified the maps are updated with hosts + * from the ReplicaSetMonitor. * Used to update the ShardRegistry when a change in replica set membership is detected by the * ReplicaSetMonitor. */ void updateLookupMapsForShard(std::shared_ptr shard, - const ConnectionString& newConnString); + boost::optional newConnString); /** * Returns a shared pointer to the shard object with the given shard id. @@ -348,7 +349,7 @@ private: /** * Creates a shard based on the specified information and puts it into the lookup maps. */ - void _addShard_inlock(const ShardType& shardType); + void _addShard_inlock(const ShardType& shardType, bool passHostName); /** * Adds the "config" shard (representing the config server) to the shard registry. @@ -356,7 +357,7 @@ private: void _addConfigShard_inlock(); void _updateLookupMapsForShard_inlock(std::shared_ptr shard, - const ConnectionString& newConnString); + boost::optional newConnString); std::shared_ptr _findUsingLookUp(const ShardId& shardId); -- cgit v1.2.1