diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2023-01-24 17:46:05 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-24 19:57:13 +0000 |
commit | d1e6694bc652cca179f2f68c39b751a78fcbd55c (patch) | |
tree | 289015565b9da9f1ffb3d7dba5cac6dac820521e | |
parent | b6152817bb33a1f128c54a8a95343dc8f57af64e (diff) | |
download | mongo-d1e6694bc652cca179f2f68c39b751a78fcbd55c.tar.gz |
SERVER-73238 Cleanup direct linking references to `sharding_api_d`
-rw-r--r-- | src/mongo/db/SConscript | 116 | ||||
-rw-r--r-- | src/mongo/db/catalog/SConscript | 5 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection.h | 10 | ||||
-rw-r--r-- | src/mongo/db/commands/dbcommands.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/op_observer/SConscript | 3 | ||||
-rw-r--r-- | src/mongo/db/op_observer/op_observer_util.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/pipeline/process_interface/SConscript | 8 | ||||
-rw-r--r-- | src/mongo/db/query/get_executor.cpp | 16 | ||||
-rw-r--r-- | src/mongo/db/query/sbe_stage_builder.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/query/sbe_stage_builder_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/db/s/SConscript | 18 | ||||
-rw-r--r-- | src/mongo/db/session/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/db/transaction/SConscript | 3 | ||||
-rw-r--r-- | src/mongo/db/update/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/embedded/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/s/commands/SConscript | 2 |
18 files changed, 96 insertions, 125 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript index 7b2ca41aa2d..be5b129289c 100644 --- a/src/mongo/db/SConscript +++ b/src/mongo/db/SConscript @@ -845,7 +845,6 @@ env.Library( 'catalog/collection_catalog', 'catalog/database_holder', 'concurrency/lock_manager', - 's/sharding_api_d', 'stats/top', 'storage/write_unit_of_work', 'views/views', @@ -1030,46 +1029,44 @@ env.Library( ) env.Library( - target="service_entry_point_common", + target='service_entry_point_common', source=[ - "service_entry_point_common.cpp", - ], - LIBDEPS=[ - '$BUILD_DIR/mongo/base', + 'service_entry_point_common.cpp', ], LIBDEPS_PRIVATE=[ - '$BUILD_DIR/mongo/db/audit', - '$BUILD_DIR/mongo/db/auth/auth', - '$BUILD_DIR/mongo/db/auth/auth_umc', - '$BUILD_DIR/mongo/db/auth/authprivilege', - '$BUILD_DIR/mongo/db/auth/user_acquisition_stats', - '$BUILD_DIR/mongo/db/command_can_run_here', - '$BUILD_DIR/mongo/db/commands/server_status_core', - '$BUILD_DIR/mongo/db/commands/txn_cmd_request', - '$BUILD_DIR/mongo/db/curop_metrics', - '$BUILD_DIR/mongo/db/ops/write_ops_exec', - '$BUILD_DIR/mongo/db/repl/repl_server_parameters', - '$BUILD_DIR/mongo/db/repl/replica_set_messages', - '$BUILD_DIR/mongo/db/repl/tenant_migration_access_blocker', - '$BUILD_DIR/mongo/db/rw_concern_d', - '$BUILD_DIR/mongo/db/s/sharding_api_d', - '$BUILD_DIR/mongo/db/session/session_catalog_mongod', - '$BUILD_DIR/mongo/db/stats/api_version_metrics', - '$BUILD_DIR/mongo/db/stats/counters', - '$BUILD_DIR/mongo/db/stats/resource_consumption_metrics', - '$BUILD_DIR/mongo/db/stats/server_read_concern_write_concern_metrics', - '$BUILD_DIR/mongo/db/stats/top', - '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file', - '$BUILD_DIR/mongo/db/storage/storage_engine_metadata', - '$BUILD_DIR/mongo/db/transaction/transaction', - '$BUILD_DIR/mongo/db/write_block_bypass', + '$BUILD_DIR/mongo/base', + 'audit', + 'auth/auth', + 'auth/auth_umc', + 'auth/authprivilege', + 'auth/user_acquisition_stats', + 'catalog/collection', + 'command_can_run_here', + 'commands/server_status_core', + 'commands/txn_cmd_request', + 'curop_metrics', 'initialize_api_parameters', 'introspect', 'multitenancy', 'not_primary_error_tracker', + 'ops/write_ops_exec', 'query_exec', + 'repl/repl_server_parameters', + 'repl/replica_set_messages', + 'repl/tenant_migration_access_blocker', + 'rw_concern_d', 'server_feature_flags', + 'session/session_catalog_mongod', 'shared_request_handling', + 'stats/api_version_metrics', + 'stats/counters', + 'stats/resource_consumption_metrics', + 'stats/server_read_concern_write_concern_metrics', + 'stats/top', + 'storage/storage_engine_lock_file', + 'storage/storage_engine_metadata', + 'transaction/transaction', + 'write_block_bypass', ], ) @@ -1235,7 +1232,6 @@ env.Library( 'concurrency/lock_manager', 'repl/repl_coordinator_interface', 'repl/repl_server_parameters', - 's/sharding_api_d', 'shared_request_handling', 'storage/storage_control', ], @@ -1254,7 +1250,6 @@ env.Library( 'repl/repl_coordinator_interface', 'repl/speculative_majority_read_info', 'repl/tenant_migration_access_blocker', - 's/sharding_api_d', 'server_base', 'shard_role', ], @@ -1343,7 +1338,7 @@ env.Library( 'exec/shard_filterer_impl.cpp', ], LIBDEPS_PRIVATE=[ - 's/sharding_api_d', + 'catalog/collection', ], ) @@ -1354,8 +1349,8 @@ env.Library( 'cursor_manager.cpp', 'exec/and_hash.cpp', 'exec/and_sorted.cpp', - 'exec/batched_delete_stage.idl', 'exec/batched_delete_stage.cpp', + 'exec/batched_delete_stage.idl', 'exec/batched_delete_stage_buffer.cpp', 'exec/cached_plan.cpp', 'exec/collection_scan.cpp', @@ -1394,8 +1389,8 @@ env.Library( 'exec/text_or.cpp', 'exec/trial_period_utils.cpp', 'exec/trial_stage.cpp', - 'exec/update_stage.cpp', 'exec/unpack_timeseries_bucket.cpp', + 'exec/update_stage.cpp', 'exec/upsert_stage.cpp', 'exec/working_set_common.cpp', 'exec/write_stage_common.cpp', @@ -1410,8 +1405,8 @@ env.Library( 'pipeline/plan_explainer_pipeline.cpp', 'query/all_indices_required_checker.cpp', 'query/bind_input_params.cpp', - 'query/cost_model/on_coefficients_change_updater_impl.cpp', 'query/classic_stage_builder.cpp', + 'query/cost_model/on_coefficients_change_updater_impl.cpp', 'query/cqf_command_utils.cpp', 'query/cqf_get_executor.cpp', 'query/explain.cpp', @@ -1741,9 +1736,10 @@ env.Library( 'transaction_validation.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/db/session/logical_session_cache_impl', + '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', 'api_parameters', 'error_labels', + 'session/logical_session_cache_impl', ], ) @@ -1944,7 +1940,6 @@ env.Library( 'dbdirectclient', 'repl/replica_set_aware_service', 'rw_concern_d', - 's/sharding_api_d', 'server_options_core', ], ) @@ -2027,18 +2022,18 @@ env.Library( 'service_context_test_fixture', ], LIBDEPS_PRIVATE=[ - '$BUILD_DIR/mongo/db/catalog/catalog_impl', - '$BUILD_DIR/mongo/db/catalog/database_holder', - '$BUILD_DIR/mongo/db/commands/mongod', - '$BUILD_DIR/mongo/db/index/index_access_method', - '$BUILD_DIR/mongo/db/s/sharding_runtime_d', - '$BUILD_DIR/mongo/db/storage/devnull/storage_devnull', - '$BUILD_DIR/mongo/db/storage/storage_control', - '$BUILD_DIR/mongo/db/storage/storage_options', - '$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger', '$BUILD_DIR/mongo/util/clock_source_mock', + 'catalog/catalog_impl', + 'catalog/database_holder', + 'commands/mongod', + 'index/index_access_method', 'index_builds_coordinator_mongod', + 's/sharding_runtime_d', 'service_context_d', + 'storage/devnull/storage_devnull', + 'storage/storage_control', + 'storage/storage_options', + 'storage/wiredtiger/storage_wiredtiger', ], ) @@ -2453,24 +2448,23 @@ env.Library( 'op_msg_fuzzer_fixture.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/transport/transport_layer_mock', ], LIBDEPS_PRIVATE=[ - '$BUILD_DIR/mongo/db/auth/auth', - '$BUILD_DIR/mongo/db/auth/authmocks', - '$BUILD_DIR/mongo/db/catalog/catalog_impl', - '$BUILD_DIR/mongo/db/catalog/database_holder', - '$BUILD_DIR/mongo/db/index/index_access_method', - '$BUILD_DIR/mongo/db/op_observer/op_observer', - '$BUILD_DIR/mongo/db/repl/replmocks', - '$BUILD_DIR/mongo/db/s/sharding_api_d', - '$BUILD_DIR/mongo/db/storage/storage_control', - '$BUILD_DIR/mongo/db/storage/storage_options', - '$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger', + '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/rpc/rpc', '$BUILD_DIR/mongo/unittest/unittest', + 'auth/auth', + 'auth/authmocks', + 'catalog/catalog_impl', + 'catalog/collection', + 'catalog/database_holder', + 'op_observer/op_observer', + 'repl/replmocks', 'service_context_d', + 'storage/storage_control', + 'storage/storage_options', + 'storage/wiredtiger/storage_wiredtiger', ], ) @@ -2483,8 +2477,8 @@ env.CppUnitTest( ], LIBDEPS=[ '$BUILD_DIR/mongo/base', - '$BUILD_DIR/mongo/db/op_msg_fuzzer_fixture', '$BUILD_DIR/mongo/rpc/rpc', + 'op_msg_fuzzer_fixture', ], ) diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript index 2771e369977..ad786397a67 100644 --- a/src/mongo/db/catalog/SConscript +++ b/src/mongo/db/catalog/SConscript @@ -233,7 +233,7 @@ env.Library( ], ) -# TODO (SERVER-72735): DO NOT ADD TO OR CHANGE THE LINKING DEPENDENCIES OF THIS LIBRARY WITHOUT +# TODO (SERVER-73238): DO NOT ADD TO OR CHANGE THE LINKING DEPENDENCIES OF THIS LIBRARY WITHOUT # CONSULTING WITH A MEMBER OF THE PM-2144 PROJECT env.Library( target='collection', @@ -242,7 +242,7 @@ env.Library( 'collection_operation_source.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/db/s/sharding_api_d', + '$BUILD_DIR/mongo/db/s/sharding_api_d_DO_NOT_ADD_MORE_USAGES', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/server_base', @@ -605,7 +605,6 @@ env.Library( '$BUILD_DIR/mongo/db/fts/base_fts', '$BUILD_DIR/mongo/db/query/op_metrics', '$BUILD_DIR/mongo/db/query/query_planner', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/service_context', 'collection', 'index_catalog', diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index 0c854f83e9b..eda5edc8eb1 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -73,9 +73,13 @@ void CollectionPtr::restore() const { } } -const BSONObj& CollectionPtr::getShardKeyPattern() const { - dassert(_shardKeyPattern); - return _shardKeyPattern.value(); +void CollectionPtr::setShardKeyPattern(const BSONObj& shardKeyPattern) { + _shardKeyPattern.emplace(shardKeyPattern.getOwned()); +} + +const ShardKeyPattern& CollectionPtr::getShardKeyPattern() const { + invariant(_shardKeyPattern); + return *_shardKeyPattern; } // ---- diff --git a/src/mongo/db/catalog/collection.h b/src/mongo/db/catalog/collection.h index 7e5fff04e1b..48e2294ca76 100644 --- a/src/mongo/db/catalog/collection.h +++ b/src/mongo/db/catalog/collection.h @@ -30,7 +30,6 @@ #pragma once #include <functional> -#include <memory> #include <string> #include <vector> @@ -54,6 +53,7 @@ #include "mongo/db/yieldable.h" #include "mongo/logv2/log_attr.h" #include "mongo/platform/mutex.h" +#include "mongo/s/shard_key_pattern.h" #include "mongo/util/decorable.h" namespace mongo { @@ -768,10 +768,8 @@ public: friend std::ostream& operator<<(std::ostream& os, const CollectionPtr& coll); - void setShardKeyPattern(const BSONObj& shardKeyPattern) { - _shardKeyPattern = shardKeyPattern.getOwned(); - } - const BSONObj& getShardKeyPattern() const; + void setShardKeyPattern(const BSONObj& shardKeyPattern); + const ShardKeyPattern& getShardKeyPattern() const; bool isSharded() const { return static_cast<bool>(_shardKeyPattern); @@ -793,7 +791,7 @@ private: // Stores a consistent view of shard key with the collection that will be needed during the // operation. If _shardKeyPattern is set, that indicates that the collection is sharded. - boost::optional<BSONObj> _shardKeyPattern = boost::none; + boost::optional<ShardKeyPattern> _shardKeyPattern = boost::none; }; inline std::ostream& operator<<(std::ostream& os, const CollectionPtr& coll) { diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index 938f93eca8d..69dae629340 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -27,9 +27,6 @@ * it in the license file. */ - -#include "mongo/platform/basic.h" - #include <ctime> #include "mongo/base/simple_string_data_comparator.h" @@ -105,7 +102,6 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand - namespace mongo { namespace { @@ -298,7 +294,7 @@ public: } if (collection.isSharded()) { - const ShardKeyPattern shardKeyPattern(collection.getShardKeyPattern()); + const auto& shardKeyPattern = collection.getShardKeyPattern(); uassert(ErrorCodes::BadValue, "keyPattern must be empty or must be an object that equals the shard key", keyPattern.isEmpty() || diff --git a/src/mongo/db/op_observer/SConscript b/src/mongo/db/op_observer/SConscript index bb33e37935e..803e0d64276 100644 --- a/src/mongo/db/op_observer/SConscript +++ b/src/mongo/db/op_observer/SConscript @@ -25,7 +25,6 @@ env.Library( '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/index/index_access_method', - '$BUILD_DIR/mongo/db/s/sharding_api_d', ], ) @@ -119,8 +118,8 @@ env.Library( 'op_observer', ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/concurrency/lock_manager', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/s/user_writes_recoverable_critical_section', ], ) diff --git a/src/mongo/db/op_observer/op_observer_util.cpp b/src/mongo/db/op_observer/op_observer_util.cpp index 62484420077..cf7571768a0 100644 --- a/src/mongo/db/op_observer/op_observer_util.cpp +++ b/src/mongo/db/op_observer/op_observer_util.cpp @@ -27,8 +27,6 @@ * it in the license file. */ -#include "mongo/platform/basic.h" - #include "mongo/db/op_observer/op_observer_util.h" #include "mongo/db/bson/dotted_path_support.h" @@ -104,9 +102,9 @@ DocumentKey getDocumentKey(OperationContext* opCtx, const CollectionPtr& coll, B boost::optional<BSONObj> shardKey; if (coll.isSharded()) { - shardKey = - dotted_path_support::extractElementsBasedOnTemplate(doc, coll.getShardKeyPattern()) - .getOwned(); + shardKey = dotted_path_support::extractElementsBasedOnTemplate( + doc, coll.getShardKeyPattern().toBSON()) + .getOwned(); } return {std::move(id), std::move(shardKey)}; diff --git a/src/mongo/db/pipeline/process_interface/SConscript b/src/mongo/db/pipeline/process_interface/SConscript index 769d2476394..b4d04581729 100644 --- a/src/mongo/db/pipeline/process_interface/SConscript +++ b/src/mongo/db/pipeline/process_interface/SConscript @@ -67,7 +67,7 @@ env.Library( ) env.Library( - target="shardsvr_process_interface", + target='shardsvr_process_interface', source=[ 'shardsvr_process_interface.cpp', ], @@ -75,8 +75,8 @@ env.Library( 'mongod_process_interfaces', ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/query_exec', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/s/sharding_api', ], ) @@ -97,8 +97,8 @@ env.Library( 'mongod_process_interface_factory.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/db/s/sharding_api_d', - '$BUILD_DIR/mongo/s/sharding_router_api', + '$BUILD_DIR/mongo/db/catalog/collection', + '$BUILD_DIR/mongo/s/sharding_api', 'mongod_process_interfaces', 'shardsvr_process_interface', ], diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp index 6c201a8a9cf..99d44a4fa43 100644 --- a/src/mongo/db/query/get_executor.cpp +++ b/src/mongo/db/query/get_executor.cpp @@ -27,21 +27,15 @@ * it in the license file. */ - -#include "mongo/db/curop.h" -#include "mongo/platform/basic.h" - #include "mongo/db/query/get_executor.h" -#include "mongo/util/duration.h" -#include "mongo/util/tick_source.h" #include <boost/optional.hpp> #include <limits> -#include <memory> #include "mongo/base/error_codes.h" #include "mongo/base/parse_number.h" #include "mongo/db/catalog/index_catalog.h" +#include "mongo/db/curop.h" #include "mongo/db/exec/cached_plan.h" #include "mongo/db/exec/collection_scan.h" #include "mongo/db/exec/count.h" @@ -110,13 +104,14 @@ #include "mongo/db/storage/storage_options.h" #include "mongo/logv2/log.h" #include "mongo/scripting/engine.h" +#include "mongo/util/duration.h" #include "mongo/util/processinfo.h" #include "mongo/util/str.h" +#include "mongo/util/tick_source.h" #include "mongo/util/timer.h" #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kQuery - namespace mongo { boost::intrusive_ptr<ExpressionContext> makeExpressionContextForGetExecutor( @@ -376,8 +371,7 @@ void fillOutPlannerParams(OperationContext* opCtx, // If the caller wants a shard filter, make sure we're actually sharded. if (plannerParams->options & QueryPlannerParams::INCLUDE_SHARD_FILTER) { if (collection.isSharded()) { - const auto& keyPattern = collection.getShardKeyPattern(); - ShardKeyPattern shardKeyPattern(keyPattern); + const auto& shardKeyPattern = collection.getShardKeyPattern(); // If the shard key is specified exactly, the query is guaranteed to only target one // shard. Shards cannot own orphans for the key ranges they own, so there is no need @@ -387,7 +381,7 @@ void fillOutPlannerParams(OperationContext* opCtx, const BSONObj extractedKey = shardKeyPattern.extractShardKeyFromQuery(*canonicalQuery); if (extractedKey.isEmpty()) { - plannerParams->shardKey = keyPattern; + plannerParams->shardKey = shardKeyPattern.toBSON(); } else { plannerParams->options &= ~QueryPlannerParams::INCLUDE_SHARD_FILTER; } diff --git a/src/mongo/db/query/sbe_stage_builder.cpp b/src/mongo/db/query/sbe_stage_builder.cpp index 37eb903e110..d48ee06aa50 100644 --- a/src/mongo/db/query/sbe_stage_builder.cpp +++ b/src/mongo/db/query/sbe_stage_builder.cpp @@ -27,9 +27,6 @@ * it in the license file. */ - -#include "mongo/platform/basic.h" - #include "mongo/db/query/sbe_stage_builder.h" #include <fmt/format.h> @@ -2741,7 +2738,7 @@ SlotBasedStageBuilder::buildShardFilterCovered(const QuerySolutionNode* root, // there are orphaned documents from aborted migrations. To check if the document is owned by // the shard, we need to own a 'ShardFilterer', and extract the document's shard key as a // BSONObj. - auto shardKeyPattern = _collections.getMainCollection().getShardKeyPattern(); + auto shardKeyPattern = _collections.getMainCollection().getShardKeyPattern().toBSON(); // We register the "shardFilterer" slot but we don't construct the ShardFilterer here, because // once constructed the ShardFilterer will prevent orphaned documents from being deleted. We // will construct the ShardFilterer later while preparing the SBE tree for execution. @@ -2845,7 +2842,7 @@ std::pair<std::unique_ptr<sbe::PlanStage>, PlanStageSlots> SlotBasedStageBuilder // there are orphaned documents from aborted migrations. To check if the document is owned by // the shard, we need to own a 'ShardFilterer', and extract the document's shard key as a // BSONObj. - auto shardKeyPattern = _collections.getMainCollection().getShardKeyPattern(); + auto shardKeyPattern = _collections.getMainCollection().getShardKeyPattern().toBSON(); // We register the "shardFilterer" slot but we don't construct the ShardFilterer here, because // once constructed the ShardFilterer will prevent orphaned documents from being deleted. We // will construct the ShardFilterer later while preparing the SBE tree for execution. diff --git a/src/mongo/db/query/sbe_stage_builder_test.cpp b/src/mongo/db/query/sbe_stage_builder_test.cpp index e712217a870..bb18e0a9c2e 100644 --- a/src/mongo/db/query/sbe_stage_builder_test.cpp +++ b/src/mongo/db/query/sbe_stage_builder_test.cpp @@ -41,7 +41,7 @@ class SbeStageBuilderTest : public SbeStageBuilderTestFixture { protected: std::unique_ptr<ShardFiltererFactoryInterface> makeAlwaysPassShardFiltererInterface() { return std::make_unique<ShardFiltererFactoryMock>( - std::make_unique<ConstantFilterMock>(true, BSONObj{})); + std::make_unique<ConstantFilterMock>(true, BSONObj{BSON("a" << 1)})); } }; diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index f9ad45f816b..78471940f71 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -1081,7 +1081,6 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/dbdirectclient', - '$BUILD_DIR/mongo/db/s/sharding_api_d', 'base_cloner', 'cloner_utils', 'repl_sync_shared_data', @@ -1324,7 +1323,6 @@ env.Library( ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/read_write_concern_defaults', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/transport/message_compressor', 'hello_auth', diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript index d66d93bf78d..77d62e6b68c 100644 --- a/src/mongo/db/s/SConscript +++ b/src/mongo/db/s/SConscript @@ -4,12 +4,9 @@ Import("env") env = env.Clone() -# This is the main library to use for consumers of sharding on a mongod shard. It will pull the -# version checking and document filtering functionality. -# -# This is the only library, which should be referenced directly outside of mongo/s/ and mongo/db/s/ +# TODO (SERVER-73238): This library is about to be decommissioned, use `catalog/collection` in the meantime env.Library( - target='sharding_api_d', + target='sharding_api_d_DO_NOT_ADD_MORE_USAGES', source=[ 'collection_metadata.cpp', 'collection_sharding_state_factory_standalone.cpp', @@ -213,6 +210,7 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/client/remote_command_targeter', + '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/catalog/multi_index_block', '$BUILD_DIR/mongo/db/client_metadata_propagation_egress_hook', '$BUILD_DIR/mongo/db/commands/mongod_fcv', @@ -233,7 +231,6 @@ env.Library( '$BUILD_DIR/mongo/s/sharding_api', '$BUILD_DIR/mongo/s/sharding_initialization', 'forwardable_operation_metadata', - 'sharding_api_d', 'sharding_catalog_manager', 'transaction_coordinator', ], @@ -275,10 +272,10 @@ env.Library( 'user_writes_recoverable_critical_section_service.cpp', ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/repl/replica_set_aware_service', '$BUILD_DIR/mongo/db/rw_concern_d', - 'sharding_api_d', ], ) @@ -302,6 +299,7 @@ env.Library( 'transaction_coordinators_stats.idl', ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/commands/server_status_core', '$BUILD_DIR/mongo/db/commands/txn_cmd_request', '$BUILD_DIR/mongo/db/dbdirectclient', @@ -313,7 +311,6 @@ env.Library( '$BUILD_DIR/mongo/db/vector_clock_mongod', '$BUILD_DIR/mongo/executor/task_executor_pool', '$BUILD_DIR/mongo/s/grid', - 'sharding_api_d', ], ) @@ -625,8 +622,8 @@ env.Library( 'sharding_logging.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', - 'sharding_api_d', ], ) @@ -867,7 +864,7 @@ env.Benchmark( 'chunk_manager_refresh_bm.cpp', ], LIBDEPS=[ - 'sharding_api_d', + '$BUILD_DIR/mongo/db/catalog/collection', ], ) @@ -891,7 +888,6 @@ env.Benchmark( LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', - '$BUILD_DIR/mongo/s/grid', '$BUILD_DIR/mongo/s/sharding_test_fixture_common', 'sharding_runtime_d', ], diff --git a/src/mongo/db/session/SConscript b/src/mongo/db/session/SConscript index a2e78cd9ec6..35fc8303d9b 100644 --- a/src/mongo/db/session/SConscript +++ b/src/mongo/db/session/SConscript @@ -134,8 +134,8 @@ env.Library( 'sessions_collection', ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/internal_transactions_feature_flag', - '$BUILD_DIR/mongo/db/s/sharding_api_d', ], ) diff --git a/src/mongo/db/transaction/SConscript b/src/mongo/db/transaction/SConscript index c9801151cf5..68c1b5920a1 100644 --- a/src/mongo/db/transaction/SConscript +++ b/src/mongo/db/transaction/SConscript @@ -71,11 +71,11 @@ env.Library( ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/auth', + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/operation_time_tracker', '$BUILD_DIR/mongo/db/query/command_request_response', '$BUILD_DIR/mongo/db/query/query_request', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/session/logical_session_id', '$BUILD_DIR/mongo/db/session/logical_session_id_helpers', @@ -105,7 +105,6 @@ env.CppUnitTest( '$BUILD_DIR/mongo/db/repl/mock_repl_coord_server_fixture', '$BUILD_DIR/mongo/db/repl/replica_set_aware_service', '$BUILD_DIR/mongo/db/repl/storage_interface_impl', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', '$BUILD_DIR/mongo/db/service_context_test_fixture', '$BUILD_DIR/mongo/db/session/session_catalog', diff --git a/src/mongo/db/update/SConscript b/src/mongo/db/update/SConscript index adc14d59d3f..55b95238595 100644 --- a/src/mongo/db/update/SConscript +++ b/src/mongo/db/update/SConscript @@ -107,8 +107,8 @@ env.Library( 'produce_document_for_upsert.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/catalog/document_validation', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/update/update_driver', ], ) diff --git a/src/mongo/embedded/SConscript b/src/mongo/embedded/SConscript index 89ba08ecc50..9e18a565ec6 100644 --- a/src/mongo/embedded/SConscript +++ b/src/mongo/embedded/SConscript @@ -98,7 +98,6 @@ env.Library( '$BUILD_DIR/mongo/db/repl/replica_set_messages', '$BUILD_DIR/mongo/db/repl/storage_interface_impl', '$BUILD_DIR/mongo/db/rw_concern_d', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/server_options', '$BUILD_DIR/mongo/db/server_options_base', '$BUILD_DIR/mongo/db/service_context', diff --git a/src/mongo/s/commands/SConscript b/src/mongo/s/commands/SConscript index 6e232c25d6b..726be825de1 100644 --- a/src/mongo/s/commands/SConscript +++ b/src/mongo/s/commands/SConscript @@ -15,10 +15,10 @@ env.Library( 'sharding_expressions.cpp', ], LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/catalog/index_key_validate', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/index/index_access_method', - '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/s/grid', '$BUILD_DIR/mongo/s/startup_initialization', ], |