summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_task_executor_pool_controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/sharding_task_executor_pool_controller.h')
-rw-r--r--src/mongo/s/sharding_task_executor_pool_controller.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/s/sharding_task_executor_pool_controller.h b/src/mongo/s/sharding_task_executor_pool_controller.h
index 4cee10bd9f6..9ef7c6bfd6c 100644
--- a/src/mongo/s/sharding_task_executor_pool_controller.h
+++ b/src/mongo/s/sharding_task_executor_pool_controller.h
@@ -40,6 +40,8 @@
namespace mongo {
+class ShardRegistry;
+
/**
* A special Controller for the sharding ConnectionPool
*
@@ -102,6 +104,9 @@ public:
synchronized_value<std::string> matchingStrategyString;
AtomicWord<MatchingStrategy> matchingStrategy;
+
+ AtomicWord<int> minConnectionsForConfigServers;
+ AtomicWord<int> maxConnectionsForConfigServers;
};
static inline Parameters gParameters;
@@ -123,7 +128,8 @@ public:
*/
static Status onUpdateMatchingStrategy(const std::string& str);
- ShardingTaskExecutorPoolController() = default;
+ explicit ShardingTaskExecutorPoolController(std::weak_ptr<ShardRegistry> shardRegistry)
+ : _shardRegistry(std::move(shardRegistry)) {}
ShardingTaskExecutorPoolController& operator=(ShardingTaskExecutorPoolController&&) = delete;
void init(ConnectionPool* parent) override;
@@ -185,6 +191,9 @@ private:
// The host associated with this pool
HostAndPort host;
+ // A pool connected to a config server gets special treatment
+ bool isConfigServer = false;
+
// The GroupData associated with this pool.
// Note that this will be invalid if there was a replica set change
std::weak_ptr<GroupData> groupData;
@@ -208,6 +217,9 @@ private:
boost::optional<PoolId> maybeId;
};
+ /** Needed by isConfigServer */
+ std::weak_ptr<ShardRegistry> const _shardRegistry;
+
std::shared_ptr<ReplicaSetChangeNotifier::Listener> _listener;
Mutex _mutex = MONGO_MAKE_LATCH("ShardingTaskExecutorPoolController::_mutex");