diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 27ba3c561a9..077cceaff07 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2972,6 +2972,8 @@ WORKSPACE.bazel @10gen/devprod-build @svc-auto-approve-bot /src/mongo/s/**/client_metadata_propagation_egress_hook* @10gen/server-networking-and-observability @svc-auto-approve-bot /src/mongo/s/**/balancer_feature_flag* @10gen/server-cluster-scalability @svc-auto-approve-bot /src/mongo/s/**/sharding_task_executor_pool* @10gen/server-networking-and-observability @svc-auto-approve-bot +/src/mongo/s/**/sharding_task_executor.* @10gen/server-catalog-and-routing-routing-and-topology @svc-auto-approve-bot +/src/mongo/s/**/sharding_task_executor_test.cpp @10gen/server-catalog-and-routing-routing-and-topology @svc-auto-approve-bot # The following patterns are parsed from ./src/mongo/s/change_streams/OWNERS.yml /src/mongo/s/change_streams/**/* @10gen/query-execution-change-streams @10gen/server-catalog-and-routing @svc-auto-approve-bot diff --git a/modules_poc/modules.yaml b/modules_poc/modules.yaml index f9d7a360e5c..3b9fe789b91 100644 --- a/modules_poc/modules.yaml +++ b/modules_poc/modules.yaml @@ -725,6 +725,7 @@ networking.execution: meta: slack: server-networking-observability jira: Networking & Observability + fully_marked: true files: - src/mongo/db/baton* - src/mongo/db/default_baton* diff --git a/src/mongo/db/baton.h b/src/mongo/db/baton.h index df72f3295f7..fb49f9a719f 100644 --- a/src/mongo/db/baton.h +++ b/src/mongo/db/baton.h @@ -32,6 +32,7 @@ #include "mongo/util/cancellation.h" #include "mongo/util/functional.h" #include "mongo/util/future.h" +#include "mongo/util/modules.h" #include "mongo/util/out_of_line_executor.h" #include "mongo/util/time_support.h" #include "mongo/util/waitable.h" @@ -51,7 +52,7 @@ class NetworkingBaton; class Baton; -using BatonHandle = std::shared_ptr; +using BatonHandle MONGO_MOD_PUBLIC = std::shared_ptr; /** * A Baton is lightweight executor, with parallel forward progress guarantees. Rather than @@ -60,9 +61,9 @@ using BatonHandle = std::shared_ptr; * * Note: This occurs automatically when opCtx waiting on a condition variable. */ -class Baton : public Waitable, - public OutOfLineExecutor, - public std::enable_shared_from_this { +class MONGO_MOD_OPEN Baton : public Waitable, + public OutOfLineExecutor, + public std::enable_shared_from_this { public: ~Baton() override = default; diff --git a/src/mongo/db/default_baton.h b/src/mongo/db/default_baton.h index 1732fb2dd79..174570ff423 100644 --- a/src/mongo/db/default_baton.h +++ b/src/mongo/db/default_baton.h @@ -35,6 +35,7 @@ #include "mongo/stdx/unordered_map.h" #include "mongo/util/clock_source.h" #include "mongo/util/functional.h" +#include "mongo/util/modules.h" #include "mongo/util/out_of_line_executor.h" #include "mongo/util/time_support.h" #include "mongo/util/waitable.h" @@ -48,7 +49,7 @@ class OperationContext; /** * The most basic Baton implementation. */ -class DefaultBaton : public Baton { +class MONGO_MOD_PUBLIC DefaultBaton : public Baton { public: explicit DefaultBaton(OperationContext* opCtx); diff --git a/src/mongo/executor/async_multicaster.h b/src/mongo/executor/async_multicaster.h index d5368d6d498..e45fa942cc5 100644 --- a/src/mongo/executor/async_multicaster.h +++ b/src/mongo/executor/async_multicaster.h @@ -34,6 +34,7 @@ #include "mongo/executor/remote_command_response.h" #include "mongo/executor/task_executor.h" #include "mongo/util/duration.h" +#include "mongo/util/modules.h" #include "mongo/util/net/hostandport.h" #include @@ -54,7 +55,7 @@ namespace executor { /** * An async harness for scatter/gathering a command across an arbitrary number of specific hosts */ -class AsyncMulticaster { +class MONGO_MOD_PUBLIC AsyncMulticaster { public: using Reply = std::tuple; static constexpr size_t kMaxConcurrency = 100; diff --git a/src/mongo/executor/async_request_executor.h b/src/mongo/executor/async_request_executor.h index 1b1fea68af4..bbdf142e51a 100644 --- a/src/mongo/executor/async_request_executor.h +++ b/src/mongo/executor/async_request_executor.h @@ -33,6 +33,7 @@ #include "mongo/db/request_execution_context.h" #include "mongo/util/concurrency/thread_pool.h" #include "mongo/util/future.h" +#include "mongo/util/modules.h" #include #include @@ -44,7 +45,7 @@ namespace mongo { * Requests (i.e., instances of `RequestExecutionContext`) are scheduled on a thread-pool, and * passed to the command-specific implementation of `handleRequest`. */ -class AsyncRequestExecutor { +class MONGO_MOD_OPEN AsyncRequestExecutor { public: AsyncRequestExecutor(AsyncRequestExecutor&&) = delete; AsyncRequestExecutor(const AsyncRequestExecutor&) = delete; diff --git a/src/mongo/executor/async_timer_mock.h b/src/mongo/executor/async_timer_mock.h index 1214dd4c992..d2d694616dc 100644 --- a/src/mongo/executor/async_timer_mock.h +++ b/src/mongo/executor/async_timer_mock.h @@ -33,6 +33,7 @@ #include "mongo/stdx/mutex.h" #include "mongo/stdx/unordered_set.h" #include "mongo/util/duration.h" +#include "mongo/util/modules.h" #include "mongo/util/time_support.h" #include @@ -102,7 +103,7 @@ private: * destroy these without destroying the underlying AsyncTimerMockImpl objects * accessed by tests and introducing races. */ -class AsyncTimerMock : public AsyncTimerInterface { +class MONGO_MOD_PUBLIC AsyncTimerMock : public AsyncTimerInterface { public: AsyncTimerMock(std::shared_ptr timer); @@ -123,7 +124,7 @@ private: * Shared pointers to timer impls are kept in a set here for access by tests, * and these are also passed into the returned AsyncTimerMock objects. */ -class AsyncTimerFactoryMock : public AsyncTimerFactoryInterface { +class MONGO_MOD_PUBLIC AsyncTimerFactoryMock : public AsyncTimerFactoryInterface { public: AsyncTimerFactoryMock() = default; diff --git a/src/mongo/executor/async_transaction_rpc.h b/src/mongo/executor/async_transaction_rpc.h index e78d07a56fa..fc201ac8faa 100644 --- a/src/mongo/executor/async_transaction_rpc.h +++ b/src/mongo/executor/async_transaction_rpc.h @@ -33,6 +33,7 @@ #include "mongo/executor/async_rpc.h" #include "mongo/s/async_rpc_shard_targeter.h" #include "mongo/s/transaction_router.h" +#include "mongo/util/modules.h" #include @@ -44,7 +45,7 @@ namespace mongo::async_rpc { * shardId. */ template -ExecutorFuture> sendTxnCommand( +MONGO_MOD_PUBLIC ExecutorFuture> sendTxnCommand( std::shared_ptr> options, OperationContext* opCtx, std::unique_ptr targeter) { diff --git a/src/mongo/executor/executor_integration_test_connection_stats.h b/src/mongo/executor/executor_integration_test_connection_stats.h index d83558816dd..3d570be8991 100644 --- a/src/mongo/executor/executor_integration_test_connection_stats.h +++ b/src/mongo/executor/executor_integration_test_connection_stats.h @@ -34,17 +34,19 @@ #include "mongo/executor/async_client_factory.h" #include "mongo/executor/connection_pool_stats.h" #include "mongo/transport/grpc_connection_stats_gen.h" +#include "mongo/util/modules.h" namespace mongo::executor { /** * Similar to assertConnectionStatsSoon but asserts on the values immediately. */ -void assertConnectionStats(const AsyncClientFactory& factory, - const HostAndPort& remote, - std::function connectionPoolTest, - std::function gRPCTest, - StringData errMsg); +MONGO_MOD_PUBLIC void assertConnectionStats( + const AsyncClientFactory& factory, + const HostAndPort& remote, + std::function connectionPoolTest, + std::function gRPCTest, + StringData errMsg); /** * Asserts that the connection stats reach a certain value within a 30 second window. If the test is @@ -54,10 +56,11 @@ void assertConnectionStats(const AsyncClientFactory& factory, * failure, a stringified version of the stats will be added to the errMsg. * TODO: SERVER-66126 Some callsites can switched to use assertConnectionStats. */ -void assertConnectionStatsSoon(const AsyncClientFactory& factory, - const HostAndPort& remote, - std::function connectionPoolTest, - std::function gRPCTest, - StringData errMsg); +MONGO_MOD_PUBLIC void assertConnectionStatsSoon( + const AsyncClientFactory& factory, + const HostAndPort& remote, + std::function connectionPoolTest, + std::function gRPCTest, + StringData errMsg); } // namespace mongo::executor diff --git a/src/mongo/executor/executor_integration_test_fixture.h b/src/mongo/executor/executor_integration_test_fixture.h index 5b8c996fe74..b3c0d856ef9 100644 --- a/src/mongo/executor/executor_integration_test_fixture.h +++ b/src/mongo/executor/executor_integration_test_fixture.h @@ -38,13 +38,14 @@ #include "mongo/unittest/log_test.h" #include "mongo/unittest/unittest.h" #include "mongo/util/duration.h" +#include "mongo/util/modules.h" #include "mongo/util/uuid.h" namespace mongo { namespace executor { -class ExecutorIntegrationTestFixture : public mongo::unittest::Test { +class MONGO_MOD_OPEN ExecutorIntegrationTestFixture : public mongo::unittest::Test { public: virtual BSONObj runSetupCommandSync(const DatabaseName& db, BSONObj cmdObj) = 0; diff --git a/src/mongo/executor/exhaust_response_reader_tl.h b/src/mongo/executor/exhaust_response_reader_tl.h index ce7437cb4da..87288434d77 100644 --- a/src/mongo/executor/exhaust_response_reader_tl.h +++ b/src/mongo/executor/exhaust_response_reader_tl.h @@ -36,6 +36,7 @@ #include "mongo/transport/transport_layer.h" #include "mongo/util/cancellation.h" #include "mongo/util/future.h" +#include "mongo/util/modules.h" #include @@ -47,7 +48,7 @@ namespace mongo::executor { * * The underlying session is returned to the pool upon destruction of the ExhaustResponseReader. */ -class ExhaustResponseReaderTL : public NetworkInterface::ExhaustResponseReader { +class MONGO_MOD_PUBLIC ExhaustResponseReaderTL : public NetworkInterface::ExhaustResponseReader { public: ExhaustResponseReaderTL(RemoteCommandRequest originalRequest, RemoteCommandResponse initialResponse, diff --git a/src/mongo/executor/pinned_connection_task_executor_factory.h b/src/mongo/executor/pinned_connection_task_executor_factory.h index 555259816d2..b1f67eb755d 100644 --- a/src/mongo/executor/pinned_connection_task_executor_factory.h +++ b/src/mongo/executor/pinned_connection_task_executor_factory.h @@ -31,11 +31,12 @@ #include "mongo/executor/network_interface.h" #include "mongo/executor/task_executor.h" +#include "mongo/util/modules.h" #include namespace mongo { -namespace executor { +namespace MONGO_MOD_PUBLIC executor { /** * Returns a new TaskExecutor that does all of its RPC execution over the same transport session. @@ -52,5 +53,5 @@ std::shared_ptr makePinnedConnectionTaskExecutor(std::shared_ptr makePinnedConnectionTaskExecutor(std::shared_ptr exec); -} // namespace executor +} // namespace MONGO_MOD_PUBLIC executor } // namespace mongo diff --git a/src/mongo/executor/pinned_connection_task_executor_registry.h b/src/mongo/executor/pinned_connection_task_executor_registry.h index 6f4c33817f3..1b76c04a514 100644 --- a/src/mongo/executor/pinned_connection_task_executor_registry.h +++ b/src/mongo/executor/pinned_connection_task_executor_registry.h @@ -30,11 +30,13 @@ #include "mongo/db/service_context.h" #include "mongo/executor/task_executor.h" +#include "mongo/util/modules.h" #include #include -namespace mongo::executor { +namespace mongo { +namespace MONGO_MOD_PUBLIC executor { struct ExecutorPair { std::weak_ptr pinned; @@ -61,4 +63,5 @@ private: // Shutdown and join all pinned executors that were built on top of 'underlying'. void shutdownPinnedExecutors(ServiceContext* svc, const std::shared_ptr& underlying); -} // namespace mongo::executor +} // namespace MONGO_MOD_PUBLIC executor +} // namespace mongo diff --git a/src/mongo/executor/pinned_connection_task_executor_test_fixture.h b/src/mongo/executor/pinned_connection_task_executor_test_fixture.h index 75ff334843f..a5608e7c4b0 100644 --- a/src/mongo/executor/pinned_connection_task_executor_test_fixture.h +++ b/src/mongo/executor/pinned_connection_task_executor_test_fixture.h @@ -44,6 +44,7 @@ #include "mongo/transport/transport_layer_mock.h" #include "mongo/unittest/unittest.h" #include "mongo/util/concurrency/thread_pool.h" +#include "mongo/util/modules.h" #include @@ -51,7 +52,7 @@ namespace mongo::executor { -class PinnedConnectionTaskExecutorTest : public ThreadPoolExecutorTest { +class MONGO_MOD_OPEN PinnedConnectionTaskExecutorTest : public ThreadPoolExecutorTest { using SinkMessageCbT = std::function; using SourceMessageCbT = std::function()>; diff --git a/src/mongo/s/OWNERS.yml b/src/mongo/s/OWNERS.yml index 38a6ffb27e1..ba61b30dc84 100644 --- a/src/mongo/s/OWNERS.yml +++ b/src/mongo/s/OWNERS.yml @@ -73,3 +73,9 @@ filters: - "sharding_task_executor_pool*": approvers: - 10gen/server-networking-and-observability + - "sharding_task_executor.*": + approvers: + - 10gen/server-catalog-and-routing-routing-and-topology + - "sharding_task_executor_test.cpp": + approvers: + - 10gen/server-catalog-and-routing-routing-and-topology diff --git a/src/mongo/s/async_requests_sender.h b/src/mongo/s/async_requests_sender.h index 273ce7ddd61..0a5f433dde9 100644 --- a/src/mongo/s/async_requests_sender.h +++ b/src/mongo/s/async_requests_sender.h @@ -44,6 +44,7 @@ #include "mongo/executor/task_executor.h" #include "mongo/util/future.h" #include "mongo/util/interruptible.h" +#include "mongo/util/modules.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/producer_consumer_queue.h" #include "mongo/util/time_support.h" @@ -93,7 +94,7 @@ namespace mongo { * * Does not throw exceptions. */ -class AsyncRequestsSender { +class MONGO_MOD_PUBLIC AsyncRequestsSender { AsyncRequestsSender(const AsyncRequestsSender&) = delete; AsyncRequestsSender& operator=(const AsyncRequestsSender&) = delete; diff --git a/src/mongo/s/async_rpc_shard_targeter.h b/src/mongo/s/async_rpc_shard_targeter.h index 1e4f7d14365..c1fa629b0b5 100644 --- a/src/mongo/s/async_rpc_shard_targeter.h +++ b/src/mongo/s/async_rpc_shard_targeter.h @@ -46,6 +46,7 @@ #include "mongo/util/cancellation.h" #include "mongo/util/future.h" #include "mongo/util/future_impl.h" +#include "mongo/util/modules.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/out_of_line_executor.h" @@ -61,7 +62,7 @@ namespace mongo { namespace async_rpc { -class ShardIdTargeter : public Targeter { +class MONGO_MOD_OPEN ShardIdTargeter : public Targeter { public: ShardIdTargeter(ExecutorPtr executor, OperationContext* opCtx, diff --git a/src/mongo/s/sharding_task_executor.h b/src/mongo/s/sharding_task_executor.h index a579476de1b..a9c95367911 100644 --- a/src/mongo/s/sharding_task_executor.h +++ b/src/mongo/s/sharding_task_executor.h @@ -38,6 +38,7 @@ #include "mongo/stdx/condition_variable.h" #include "mongo/util/future.h" #include "mongo/util/interruptible.h" +#include "mongo/util/modules.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/time_support.h" @@ -54,7 +55,7 @@ class ThreadPoolTaskExecutor; * Implementation of a TaskExecutor that uses ThreadPoolTaskExecutor to submit tasks and allows to * override methods if needed. */ -class ShardingTaskExecutor final : public TaskExecutor { +class MONGO_MOD_PUBLIC ShardingTaskExecutor final : public TaskExecutor { struct Passkey { explicit Passkey() = default; }; diff --git a/src/mongo/s/sharding_task_executor_pool_controller.h b/src/mongo/s/sharding_task_executor_pool_controller.h index 8df64a5e4dc..33df12b4ed8 100644 --- a/src/mongo/s/sharding_task_executor_pool_controller.h +++ b/src/mongo/s/sharding_task_executor_pool_controller.h @@ -41,6 +41,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/with_lock.h" #include "mongo/util/duration.h" +#include "mongo/util/modules.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/synchronized_value.h" @@ -81,7 +82,7 @@ class ShardRegistry; * * The ServerParameters can update the Parameters which will used in the next update * * The SpecificPools for its ConnectionPool can updateHost with their individual States */ -class ShardingTaskExecutorPoolController final +class MONGO_MOD_PUBLIC ShardingTaskExecutorPoolController final : public executor::ConnectionPool::ControllerInterface { class ReplicaSetChangeListener;