summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2022-08-18 10:29:06 +0200
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-18 16:00:39 +0000
commit180f4490bfcb1600bec464d65529e03ba11e9717 (patch)
tree00e5eb4fede81b38ec8e31af89a94ea22931cfed /src
parent38c6756ee1b0990253afb9fbccaf91b7d985241f (diff)
downloadmongo-180f4490bfcb1600bec464d65529e03ba11e9717.tar.gz
SERVER-68826 Introduce the server_base library
Diffstat (limited to 'src')
-rw-r--r--src/mongo/client/SConscript3
-rw-r--r--src/mongo/db/SConscript122
-rw-r--r--src/mongo/db/auth/SConscript25
-rw-r--r--src/mongo/db/catalog/SConscript45
-rw-r--r--src/mongo/db/catalog/clustered_collection_util.cpp2
-rw-r--r--src/mongo/db/catalog/commit_quorum_options.cpp3
-rw-r--r--src/mongo/db/commands/SConscript33
-rw-r--r--src/mongo/db/concurrency/SConscript3
-rw-r--r--src/mongo/db/index/SConscript33
-rw-r--r--src/mongo/db/op_observer/oplog_writer.h2
-rw-r--r--src/mongo/db/pipeline/SConscript3
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream_handle_topology_change.h2
-rw-r--r--src/mongo/db/process_health/SConscript11
-rw-r--r--src/mongo/db/query/SConscript116
-rw-r--r--src/mongo/db/query/ce/SConscript10
-rw-r--r--src/mongo/db/repl/SConscript49
-rw-r--r--src/mongo/db/repl/oplog_test.cpp4
-rw-r--r--src/mongo/db/s/SConscript10
-rw-r--r--src/mongo/db/s/add_shard_util.cpp2
-rw-r--r--src/mongo/db/s/balancer/balancer_commands_scheduler.h2
-rw-r--r--src/mongo/db/s/balancer/balancer_commands_scheduler_impl.cpp2
-rw-r--r--src/mongo/db/s/balancer/balancer_policy.h2
-rw-r--r--src/mongo/db/s/balancer/cluster_statistics.h2
-rw-r--r--src/mongo/db/s/config/config_server_test_fixture.cpp2
-rw-r--r--src/mongo/db/s/config/initial_split_policy.h2
-rw-r--r--src/mongo/db/s/global_index/global_index_cloner_fetcher.h2
-rw-r--r--src/mongo/db/s/migration_destination_manager.h2
-rw-r--r--src/mongo/db/s/move_primary_coordinator.cpp2
-rw-r--r--src/mongo/db/s/move_primary_source_manager.h2
-rw-r--r--src/mongo/db/s/move_timing_helper.h2
-rw-r--r--src/mongo/db/s/resharding/document_source_resharding_ownership_match.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_collection_cloner.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_coordinator_commit_monitor.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_coordinator_commit_monitor_test.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_coordinator_observer.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_coordinator_observer_test.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_coordinator_service.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_coordinator_service.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_data_replication.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_fetcher.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_recipient_service_external_state.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_util.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_util_test.cpp2
-rw-r--r--src/mongo/db/s/session_catalog_migration_destination.cpp2
-rw-r--r--src/mongo/db/s/session_catalog_migration_destination.h2
-rw-r--r--src/mongo/db/s/sharding_state.h2
-rw-r--r--src/mongo/db/s/sharding_util.h2
-rw-r--r--src/mongo/db/s/sharding_util_refresh_test.cpp2
-rw-r--r--src/mongo/db/s/start_chunk_clone_request.h2
-rw-r--r--src/mongo/db/s/start_chunk_clone_request_test.cpp2
-rw-r--r--src/mongo/db/s/transaction_coordinator_futures_util.h2
-rw-r--r--src/mongo/db/s/transaction_coordinator_structures.h2
-rw-r--r--src/mongo/db/s/transaction_coordinator_test_fixture.h2
-rw-r--r--src/mongo/db/s/type_shard_database.idl2
-rw-r--r--src/mongo/db/serverless/SConscript4
-rw-r--r--src/mongo/db/shard_id.cpp (renamed from src/mongo/s/shard_id.cpp)15
-rw-r--r--src/mongo/db/shard_id.h (renamed from src/mongo/s/shard_id.h)1
-rw-r--r--src/mongo/db/shard_id_test.cpp (renamed from src/mongo/s/shard_id_test.cpp)2
-rw-r--r--src/mongo/db/stats/SConscript6
-rw-r--r--src/mongo/db/storage/SConscript41
-rw-r--r--src/mongo/db/storage/devnull/SConscript3
-rw-r--r--src/mongo/db/storage/wiredtiger/SConscript3
-rw-r--r--src/mongo/db/timeseries/SConscript12
-rw-r--r--src/mongo/db/write_concern_options.cpp8
-rw-r--r--src/mongo/idl/SConscript3
-rw-r--r--src/mongo/logv2/SConscript3
-rw-r--r--src/mongo/rpc/SConscript5
-rw-r--r--src/mongo/rpc/write_concern_error_detail.cpp5
-rw-r--r--src/mongo/s/SConscript6
-rw-r--r--src/mongo/s/async_requests_sender.h2
-rw-r--r--src/mongo/s/catalog/type_chunk.h2
-rw-r--r--src/mongo/s/catalog/type_database.idl2
-rw-r--r--src/mongo/s/catalog/type_shard.h2
-rw-r--r--src/mongo/s/catalog/types_validators.h12
-rw-r--r--src/mongo/s/client/shard.h2
-rw-r--r--src/mongo/s/client/shard_remote_test.cpp3
-rw-r--r--src/mongo/s/cluster_commands_helpers.cpp2
-rw-r--r--src/mongo/s/query/async_results_merger_params.idl2
-rw-r--r--src/mongo/s/query/cluster_aggregation_planner.cpp2
-rw-r--r--src/mongo/s/query/store_possible_cursor.cpp2
-rw-r--r--src/mongo/s/query/store_possible_cursor.h2
-rw-r--r--src/mongo/s/remote_command_shard_targeter.h2
-rw-r--r--src/mongo/s/remote_command_shard_targeter_test.cpp2
-rw-r--r--src/mongo/s/request_types/balance_chunk_request_type.h2
-rw-r--r--src/mongo/s/request_types/move_range_request.idl4
-rw-r--r--src/mongo/s/sharding_types.idl2
-rw-r--r--src/mongo/s/stale_exception.h2
-rw-r--r--src/mongo/s/stale_exception_test.cpp1
-rw-r--r--src/mongo/s/transaction_router.h2
90 files changed, 297 insertions, 422 deletions
diff --git a/src/mongo/client/SConscript b/src/mongo/client/SConscript
index d7bdacce9b0..25df63559cc 100644
--- a/src/mongo/client/SConscript
+++ b/src/mongo/client/SConscript
@@ -324,8 +324,7 @@ env.Library(
'fetcher.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/executor/task_executor_interface',
'$BUILD_DIR/mongo/rpc/command_status',
'remote_command_retry_scheduler',
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 14c93d61efa..f499c05b83d 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -54,6 +54,23 @@ env.SConscript(
],
)
+# The 'server_base' library must only contain basic, stateless, value types which are used throughout
+# all the server binaries. It must not depend on anything other than utilities that are outside of
+# the server codebase.
+env.Library(
+ target='server_base', source=[
+ 'database_name.cpp',
+ 'index_names.cpp',
+ 'keypattern.cpp',
+ 'multitenancy.idl',
+ 'namespace_string.cpp',
+ 'shard_id.cpp',
+ 'shutdown_in_progress_quiesce_info.cpp',
+ ], LIBDEPS=[
+ '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/idl/server_parameter',
+ ])
+
#
# The db/'common' lib has the abstractions that are shared by components of the
# server. Ideally, many of the object in 'coredb' should be moved here when their dependencies
@@ -66,17 +83,13 @@ env.Library(
'field_ref.cpp',
'field_ref_set.cpp',
'field_parser.cpp',
- 'keypattern.cpp',
'txn_retry_counter_too_old_info.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/cannot_convert_index_to_unique_info',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/repl/tenant_migration_errors',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/write_concern_options',
- 'process_health_feature_flag',
- 'shutdown_in_progress_quiesce_info',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/catalog/collection_uuid_mismatch_info',
@@ -88,29 +101,16 @@ env.Library(
source=[
'multitenancy.cpp',
],
- LIBDEPS=[
- 'multitenancy_params',
- ],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/auth',
'$BUILD_DIR/mongo/db/auth/security_token',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/feature_flag',
'server_feature_flags',
],
)
env.Library(
- target='shutdown_in_progress_quiesce_info',
- source=[
- 'shutdown_in_progress_quiesce_info.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- ],
-)
-
-env.Library(
target="dbmessage",
source=[
"dbmessage.cpp",
@@ -200,17 +200,6 @@ env.Library(
)
env.Library(
- target='index_names',
- source=[
- "index_names.cpp",
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
- ],
-)
-
-env.Library(
target='mongohasher',
source=[
"hasher.cpp",
@@ -233,22 +222,6 @@ env.Library(
)
env.Library(
- target='namespace_string',
- source=[
- 'namespace_string.cpp',
- 'database_name.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/repl/optime',
- 'multitenancy_params',
- ],
- LIBDEPS_PRIVATE=[
- 'server_options_core',
- ],
-)
-
-env.Library(
target='tenant_id',
source=[
'tenant_id.cpp',
@@ -274,23 +247,9 @@ env.Library(
'collection_index_usage_tracker.cpp',
'global_index_usage_tracker.cpp',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/commands/server_status_core',
- ],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/index_names',
- ],
-)
-
-env.Library(
- target='multitenancy_params',
- source=[
- 'multitenancy.idl',
- ],
- LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/idl/server_parameter',
+ '$BUILD_DIR/mongo/db/commands/server_status_core',
+ '$BUILD_DIR/mongo/db/server_base',
],
)
@@ -582,10 +541,10 @@ env.Library(
'$BUILD_DIR/mongo/db/concurrency/exception_util',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/db_raii',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/query_exec',
'$BUILD_DIR/mongo/db/record_id_helpers',
'$BUILD_DIR/mongo/db/repl/storage_interface',
+ 'server_base',
],
)
@@ -799,7 +758,7 @@ env.Library(
'audit',
'coll_mod_command_idl',
'index_commands_idl',
- 'namespace_string',
+ 'server_base',
],
)
@@ -849,16 +808,6 @@ env.Library(
)
env.Library(
- target='process_health_feature_flag',
- source=[
- 'process_health/health_monitoring.idl',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/idl/feature_flag',
- ],
-)
-
-env.Library(
target='catalog_raii',
source=[
'catalog/catalog_helper.cpp',
@@ -868,7 +817,6 @@ env.Library(
'catalog/collection',
'catalog/collection_catalog',
'concurrency/lock_manager',
- 'namespace_string',
'views/views',
],
LIBDEPS_PRIVATE=[
@@ -876,6 +824,7 @@ env.Library(
'$BUILD_DIR/mongo/db/catalog/local_oplog_info',
'$BUILD_DIR/mongo/db/s/sharding_api_d',
'multitenancy',
+ 'server_base',
],
)
@@ -1176,7 +1125,7 @@ env.Library(
"catalog_raii",
"db_raii",
"dbhelpers",
- "namespace_string",
+ "server_base",
"service_context",
],
)
@@ -1793,7 +1742,7 @@ env.Library(
'$BUILD_DIR/mongo/s/catalog/sharding_catalog_client',
'keys_collection_document',
'logical_time',
- 'namespace_string',
+ 'server_base',
],
)
@@ -2001,7 +1950,7 @@ env.Library(
LIBDEPS=[
'$BUILD_DIR/mongo/db/repl/optime',
'$BUILD_DIR/mongo/idl/idl_parser',
- 'namespace_string',
+ 'server_base',
'service_context',
],
)
@@ -2406,17 +2355,19 @@ if wiredtiger:
source=[
'cancelable_operation_context_test.cpp',
'catalog_raii_test.cpp',
- 'client_strand_test.cpp',
'client_context_test.cpp',
+ 'client_strand_test.cpp',
'collection_index_usage_tracker_test.cpp',
+ 'commands_test_example.idl',
'commands_test.cpp',
'curop_test.cpp',
'database_name_test.cpp',
+ 'db_raii_multi_collection_test.cpp',
+ 'db_raii_test.cpp',
'dbdirectclient_test.cpp',
'dbmessage_test.cpp',
- 'db_raii_test.cpp',
- 'db_raii_multi_collection_test.cpp',
- "explain_test.cpp",
+ 'error_labels_test.cpp',
+ 'explain_test.cpp',
'field_parser_test.cpp',
'field_ref_set_test.cpp',
'field_ref_test.cpp',
@@ -2450,6 +2401,7 @@ if wiredtiger:
'session/logical_session_id_test.cpp',
'session/session_catalog_mongod_test.cpp',
'session/session_catalog_test.cpp',
+ 'shard_id_test.cpp',
'startup_warnings_mongod_test.cpp',
'thread_client_test.cpp',
'time_proof_service_test.cpp',
@@ -2464,11 +2416,8 @@ if wiredtiger:
'vector_clock_test.cpp',
'wire_version_test.cpp',
'write_concern_options_test.cpp',
- 'error_labels_test.cpp',
- 'commands_test_example.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/bson/util/bson_extract',
'$BUILD_DIR/mongo/client/read_preference',
'$BUILD_DIR/mongo/crypto/encrypted_field_config',
@@ -2542,14 +2491,13 @@ if wiredtiger:
'logical_time',
'mirror_maestro',
'multitenancy',
- 'multitenancy_params',
- 'namespace_string',
'operation_time_tracker',
'query_exec',
'range_arithmetic',
'read_write_concern_defaults_mock',
'record_id_helpers',
'rw_concern_d',
+ 'server_base',
'server_options_core',
'server_options_servers',
'service_context',
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index 100568c6a18..74bf06ee38f 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -11,12 +11,9 @@ env.Library(
'security_token.idl',
'validated_tenancy_scope.cpp',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- ],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/auth/auth',
- '$BUILD_DIR/mongo/db/multitenancy_params',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_feature_flags',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/idl/feature_flag',
@@ -48,11 +45,10 @@ env.Library(
'role_name_or_string.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/multitenancy_params',
'$BUILD_DIR/mongo/db/service_context',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/server_base',
'auth_options',
'cluster_auth_mode',
'sasl_options',
@@ -146,13 +142,12 @@ generateBuiltinRoles = env_for_builtin_roles.Command(
env.Alias('generated-sources', generateBuiltinRoles)
env.Library(
- target="builtin_roles",
+ target='builtin_roles',
source=[
'builtin_roles.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'auth',
'auth_options',
'authprivilege',
@@ -207,13 +202,11 @@ env.Library(
'authorization_manager_impl_parameters.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/base/secure_allocator',
'$BUILD_DIR/mongo/bson/util/bson_extract',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/global_settings',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/idl/feature_flag',
'$BUILD_DIR/mongo/util/concurrency/thread_pool',
'$BUILD_DIR/mongo/util/icu',
@@ -232,6 +225,7 @@ env.Library(
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/api_parameters',
'$BUILD_DIR/mongo/db/audit', # audit:logLogout in AuthZSession.
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/stats/counters',
'$BUILD_DIR/mongo/idl/server_parameter',
'$BUILD_DIR/mongo/util/caching',
@@ -246,11 +240,10 @@ env.Library(
'authorization_checks.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/document_validation',
'$BUILD_DIR/mongo/db/common',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/pipeline/lite_parsed_document_source',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/update/update_driver',
'auth',
'authorization_manager_global',
@@ -446,7 +439,6 @@ env.Library(
'sasl_scram_server_conversation.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/base/secure_allocator',
'$BUILD_DIR/mongo/crypto/asymmetric_crypto',
'$BUILD_DIR/mongo/crypto/rsa_public_key',
@@ -461,6 +453,8 @@ env.Library(
'user',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/server_base',
+ '$BUILD_DIR/mongo/db/service_context',
'cluster_auth_mode',
],
)
@@ -541,7 +535,8 @@ env.Library(
'user_cache_acquisition_stats.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/db/server_base',
+ '$BUILD_DIR/mongo/db/service_context',
'auth',
],
)
diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript
index cc625737820..c07e0f32a2b 100644
--- a/src/mongo/db/catalog/SConscript
+++ b/src/mongo/db/catalog/SConscript
@@ -21,8 +21,7 @@ env.Library(
'clustered_collection_util.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/basic_types',
'$BUILD_DIR/mongo/idl/idl_parser',
'$BUILD_DIR/mongo/idl/server_parameter',
@@ -102,15 +101,14 @@ env.Library(
env.Library(
target='health_log',
source=[
- "health_log.cpp",
- "health_log.idl",
+ 'health_log.cpp',
+ 'health_log.idl',
],
LIBDEPS_PRIVATE=[
- "$BUILD_DIR/mongo/base",
- "$BUILD_DIR/mongo/db/concurrency/deferred_writer",
- '$BUILD_DIR/mongo/db/namespace_string',
- "$BUILD_DIR/mongo/db/service_context",
- "$BUILD_DIR/mongo/idl/idl_parser",
+ '$BUILD_DIR/mongo/db/concurrency/deferred_writer',
+ '$BUILD_DIR/mongo/db/server_base',
+ '$BUILD_DIR/mongo/db/service_context',
+ '$BUILD_DIR/mongo/idl/idl_parser',
'collection_options',
],
)
@@ -166,16 +164,15 @@ env.Library(
env.Library(
target='index_key_validate',
source=[
- "index_key_validate.cpp",
+ 'index_key_validate.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/index/index_descriptor',
'$BUILD_DIR/mongo/db/index/key_generator',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/matcher/expressions',
'$BUILD_DIR/mongo/db/query/collation/collator_factory_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/util/fail_point',
],
)
@@ -204,20 +201,18 @@ env.Library(
env.Library(
target='index_build_block',
source=[
- "index_build_block.cpp",
+ 'index_build_block.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/audit',
'$BUILD_DIR/mongo/db/collection_index_usage_tracker',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/index/index_access_method',
'$BUILD_DIR/mongo/db/index/index_descriptor',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/ttl_collection_cache',
'$BUILD_DIR/mongo/db/vector_clock',
- 'collection',
'collection_catalog',
'collection_query_info',
],
@@ -306,9 +301,9 @@ env.Library(
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/profile_filter',
'$BUILD_DIR/mongo/db/query/collation/collator_factory_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_feature_flags',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/db/service_context',
@@ -336,13 +331,14 @@ env.Benchmark(
env.Library(
target='catalog_control',
source=[
- "catalog_control.cpp",
+ 'catalog_control.cpp',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/index_builds_coordinator_interface',
'$BUILD_DIR/mongo/db/multitenancy',
'$BUILD_DIR/mongo/db/rebuild_indexes',
'$BUILD_DIR/mongo/db/repl/oplog',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/timeseries/timeseries_extended_range',
'collection',
@@ -460,18 +456,18 @@ env.Library(
'validate_results.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/bson/util/bson_column',
'$BUILD_DIR/mongo/db/concurrency/exception_util',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/index/index_access_method',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/multi_key_path_tracker',
'$BUILD_DIR/mongo/db/record_id_helpers',
- "$BUILD_DIR/mongo/db/service_context",
+ '$BUILD_DIR/mongo/db/server_base',
+ '$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/storage/execution_context',
'$BUILD_DIR/mongo/db/storage/key_string',
+ '$BUILD_DIR/mongo/db/storage/record_store_base',
'$BUILD_DIR/mongo/db/timeseries/bucket_catalog',
'$BUILD_DIR/mongo/db/timeseries/timeseries_options',
'$BUILD_DIR/mongo/idl/basic_types',
@@ -596,8 +592,7 @@ env.Library(
'import_collection_oplog_entry.idl',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/idl_parser',
],
)
@@ -609,10 +604,10 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authmocks',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/repl/replmocks',
'$BUILD_DIR/mongo/db/repl/storage_interface_impl',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context_d_test_fixture',
'catalog_helpers',
],
@@ -686,7 +681,6 @@ if wiredtiger:
'$BUILD_DIR/mongo/db/index_builds_coordinator_mongod',
'$BUILD_DIR/mongo/db/matcher/expressions',
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/op_observer/op_observer',
'$BUILD_DIR/mongo/db/op_observer/op_observer_impl',
'$BUILD_DIR/mongo/db/query/datetime/date_time_support',
@@ -697,6 +691,7 @@ if wiredtiger:
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/repl/replmocks',
'$BUILD_DIR/mongo/db/repl/storage_interface_impl',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/service_context_d_test_fixture',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
diff --git a/src/mongo/db/catalog/clustered_collection_util.cpp b/src/mongo/db/catalog/clustered_collection_util.cpp
index 04316f17ed2..4255e8c82f2 100644
--- a/src/mongo/db/catalog/clustered_collection_util.cpp
+++ b/src/mongo/db/catalog/clustered_collection_util.cpp
@@ -124,7 +124,7 @@ BSONObj formatClusterKeyForListIndexes(const ClusteredCollectionInfo& collInfo,
}
bool isClusteredOnId(const boost::optional<ClusteredCollectionInfo>& collInfo) {
- return clustered_util::matchesClusterKey(BSON("_id" << 1), collInfo);
+ return matchesClusterKey(BSON("_id" << 1), collInfo);
}
bool matchesClusterKey(const BSONObj& keyPatternObj,
diff --git a/src/mongo/db/catalog/commit_quorum_options.cpp b/src/mongo/db/catalog/commit_quorum_options.cpp
index c5f575f144f..9a12abdfe23 100644
--- a/src/mongo/db/catalog/commit_quorum_options.cpp
+++ b/src/mongo/db/catalog/commit_quorum_options.cpp
@@ -27,14 +27,11 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include "mongo/db/catalog/commit_quorum_options.h"
#include "mongo/base/status.h"
#include "mongo/base/string_data.h"
#include "mongo/bson/util/bson_extract.h"
-#include "mongo/db/field_parser.h"
#include "mongo/db/repl/repl_set_config.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index f991bdbb73b..02048827820 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -64,16 +64,13 @@ env.Library(
)
env.Library(
- target="feature_compatibility_parsers",
+ target='feature_compatibility_parsers',
source=[
- "feature_compatibility_version_parser.cpp",
+ 'feature_compatibility_version_parser.cpp',
'feature_compatibility_version_document.idl',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
- ],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/idl_parser',
],
)
@@ -113,8 +110,8 @@ env.Library(
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/fle_crud',
'$BUILD_DIR/mongo/db/mongohasher',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/ops/write_ops_parsers',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/db/session/kill_sessions',
'$BUILD_DIR/mongo/db/session/logical_session_cache',
@@ -165,12 +162,12 @@ env.Library(
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/log_process_details',
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/multitenancy_params',
'$BUILD_DIR/mongo/db/pipeline/change_stream_pipeline',
'$BUILD_DIR/mongo/db/pipeline/document_source_internal_apply_oplog_update',
'$BUILD_DIR/mongo/db/pipeline/pipeline',
'$BUILD_DIR/mongo/db/repl/isself',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/session/logical_session_cache',
'$BUILD_DIR/mongo/db/session/logical_session_cache_impl',
'$BUILD_DIR/mongo/db/session/logical_session_id',
@@ -493,7 +490,7 @@ env.Library(
'rename_collection.idl',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/idl_parser',
],
)
@@ -601,7 +598,6 @@ env.Library(
'$BUILD_DIR/mongo/db/repl/tenant_migration_donor_service',
'$BUILD_DIR/mongo/db/repl/tenant_migration_recipient_service',
'$BUILD_DIR/mongo/db/rw_concern_d',
- '$BUILD_DIR/mongo/db/s/sharding_api_d',
'$BUILD_DIR/mongo/db/s/sharding_catalog_manager',
'$BUILD_DIR/mongo/db/s/sharding_commands_d',
'$BUILD_DIR/mongo/db/s/sharding_runtime_d',
@@ -678,9 +674,9 @@ env.Library(
'$BUILD_DIR/mongo/db/commands',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/pipeline/aggregation_request_helper',
'$BUILD_DIR/mongo/db/query/command_request_response',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
'test_commands_enabled',
],
@@ -765,20 +761,23 @@ env.Library(
'map_reduce_agg.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands/servers', '$BUILD_DIR/mongo/db/db_raii',
+ '$BUILD_DIR/mongo/db/commands/servers',
+ '$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/index/index_access_methods',
'$BUILD_DIR/mongo/db/pipeline/process_interface/mongo_process_interface',
'$BUILD_DIR/mongo/db/pipeline/process_interface/mongod_process_interface_factory',
- '$BUILD_DIR/mongo/db/query/map_reduce_output_format', '$BUILD_DIR/mongo/db/query_exec',
- '$BUILD_DIR/mongo/idl/idl_parser', 'map_reduce_parser'
+ '$BUILD_DIR/mongo/db/query/map_reduce_output_format',
+ '$BUILD_DIR/mongo/db/query_exec',
+ '$BUILD_DIR/mongo/idl/idl_parser',
+ 'map_reduce_parser',
],
)
env.CppUnitTest(
- target="map_reduce_agg_test",
+ target='map_reduce_agg_test',
source=[
- "map_reduce_agg_test.cpp",
- "map_reduce_parse_test.cpp",
+ 'map_reduce_agg_test.cpp',
+ 'map_reduce_parse_test.cpp',
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authmocks',
diff --git a/src/mongo/db/concurrency/SConscript b/src/mongo/db/concurrency/SConscript
index c5a91b12387..d3a57d2feed 100644
--- a/src/mongo/db/concurrency/SConscript
+++ b/src/mongo/db/concurrency/SConscript
@@ -60,7 +60,6 @@ env.Library(
'replication_state_transition_lock_guard.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/storage/storage_engine_parameters',
'$BUILD_DIR/mongo/util/background_job',
@@ -72,7 +71,7 @@ env.Library(
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/catalog/collection_catalog',
'$BUILD_DIR/mongo/db/concurrency/flow_control_ticketholder',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
],
)
diff --git a/src/mongo/db/index/SConscript b/src/mongo/db/index/SConscript
index 484b9e4dec6..88e99949a27 100644
--- a/src/mongo/db/index/SConscript
+++ b/src/mongo/db/index/SConscript
@@ -10,12 +10,10 @@ env.Library(
'index_descriptor.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/index_catalog',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/matcher/expressions',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/query/collation/collator_factory_interface',
+ '$BUILD_DIR/mongo/db/server_base',
],
)
@@ -29,19 +27,18 @@ env.Library(
'wildcard_key_generator.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/bson/dotted_path_support',
'$BUILD_DIR/mongo/db/exec/projection_executor',
'$BUILD_DIR/mongo/db/exec/working_set',
'$BUILD_DIR/mongo/db/fts/base_fts',
'$BUILD_DIR/mongo/db/geo/geoparser',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/mongohasher',
'$BUILD_DIR/mongo/db/pipeline/document_path_support',
'$BUILD_DIR/mongo/db/query/collation/collator_interface',
'$BUILD_DIR/mongo/db/query/projection_ast',
'$BUILD_DIR/mongo/db/query/sort_pattern',
'$BUILD_DIR/mongo/db/record_id_helpers',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/timeseries/timeseries_conversion_util',
'$BUILD_DIR/third_party/s2/s2',
'expression_params',
@@ -79,8 +76,7 @@ env.Library(
'index_access_method_factory.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/index_names',
+ '$BUILD_DIR/mongo/db/server_base',
],
)
@@ -138,28 +134,27 @@ iamEnv.Library(
)
env.Library(
- target="index_access_methods",
+ target='index_access_methods',
source=[
- "2d_access_method.cpp",
- "columns_access_method.cpp",
- "btree_access_method.cpp",
- "fts_access_method.cpp",
- "hash_access_method.cpp",
- "index_access_method_factory_impl.cpp",
- "s2_access_method.cpp",
- "s2_bucket_access_method.cpp",
- "wildcard_access_method.cpp",
+ '2d_access_method.cpp',
+ 'columns_access_method.cpp',
+ 'btree_access_method.cpp',
+ 'fts_access_method.cpp',
+ 'hash_access_method.cpp',
+ 'index_access_method_factory_impl.cpp',
+ 's2_access_method.cpp',
+ 's2_bucket_access_method.cpp',
+ 'wildcard_access_method.cpp',
],
LIBDEPS=[
'index_access_method',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/concurrency/exception_util',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/fts/base_fts',
- '$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/resumable_index_builds_idl',
+ '$BUILD_DIR/mongo/db/server_base',
'column_store_index',
'expression_params',
'key_generator',
diff --git a/src/mongo/db/op_observer/oplog_writer.h b/src/mongo/db/op_observer/oplog_writer.h
index b754c6faf57..c7b9a0eb462 100644
--- a/src/mongo/db/op_observer/oplog_writer.h
+++ b/src/mongo/db/op_observer/oplog_writer.h
@@ -39,7 +39,7 @@
#include "mongo/db/repl/oplog.h" // for InsertStatement and OplogLink
#include "mongo/db/repl/oplog_entry.h" // for MutableOplogEntry
#include "mongo/db/session/logical_session_id.h" // for StmtId
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript
index 2b648db4ee2..d745e2ac113 100644
--- a/src/mongo/db/pipeline/SConscript
+++ b/src/mongo/db/pipeline/SConscript
@@ -69,13 +69,12 @@ env.Library(
'aggregate_command.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/exec/document_value/document_value',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/query/command_request_response',
'$BUILD_DIR/mongo/db/query/common_query_enums_and_helpers',
'$BUILD_DIR/mongo/db/query/query_request',
'$BUILD_DIR/mongo/db/repl/read_concern_args',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/storage/storage_options',
'$BUILD_DIR/mongo/db/write_concern_options',
'$BUILD_DIR/mongo/idl/idl_parser',
diff --git a/src/mongo/db/pipeline/document_source_change_stream_handle_topology_change.h b/src/mongo/db/pipeline/document_source_change_stream_handle_topology_change.h
index 4c07368aff9..dd6ef23cb2c 100644
--- a/src/mongo/db/pipeline/document_source_change_stream_handle_topology_change.h
+++ b/src/mongo/db/pipeline/document_source_change_stream_handle_topology_change.h
@@ -34,8 +34,8 @@
#include "mongo/db/pipeline/change_stream_constants.h"
#include "mongo/db/pipeline/document_source.h"
#include "mongo/db/pipeline/document_source_change_stream.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/query/document_source_merge_cursors.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/process_health/SConscript b/src/mongo/db/process_health/SConscript
index 4fc5b9e855b..d90819ef330 100644
--- a/src/mongo/db/process_health/SConscript
+++ b/src/mongo/db/process_health/SConscript
@@ -8,13 +8,14 @@ env.Library(
target='fault_manager',
source=[
'dns_health_observer.cpp',
- 'fault.cpp',
'fault_facet_impl.cpp',
- 'fault_manager.cpp',
'fault_manager_config.cpp',
- 'health_monitoring_server_parameters.idl',
+ 'fault_manager.cpp',
+ 'fault.cpp',
'health_monitoring_server_parameters.cpp',
+ 'health_monitoring_server_parameters.idl',
'health_monitoring_server_status_section.cpp',
+ 'health_monitoring.idl',
'health_observer_base.cpp',
'health_observer_registration.cpp',
'progress_monitor.cpp',
@@ -28,10 +29,10 @@ env.Library(
'$BUILD_DIR/mongo/executor/network_interface_factory',
'$BUILD_DIR/mongo/executor/network_interface_thread_pool',
'$BUILD_DIR/mongo/executor/thread_pool_task_executor',
- '$BUILD_DIR/mongo/s/grid',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/process_health_feature_flag',
+ '$BUILD_DIR/mongo/idl/feature_flag',
+ '$BUILD_DIR/mongo/s/grid',
'$BUILD_DIR/mongo/util/concurrency/thread_pool',
],
)
diff --git a/src/mongo/db/query/SConscript b/src/mongo/db/query/SConscript
index 60006fb136d..397e0d8a81f 100644
--- a/src/mongo/db/query/SConscript
+++ b/src/mongo/db/query/SConscript
@@ -37,41 +37,40 @@ env.Library(
)
env.Library(
- target="query_planner",
+ target='query_planner',
source=[
- "expression_index_knobs.idl",
- "expression_index.cpp",
- "index_bounds_builder.cpp",
- "interval_evaluation_tree.cpp",
- "plan_cache_indexability.cpp",
- "plan_enumerator.cpp",
- "planner_access.cpp",
- "planner_analysis.cpp",
- "planner_ixselect.cpp",
- "planner_wildcard_helpers.cpp",
- "query_planner_common.cpp",
- "query_planner.cpp",
- "query_settings.cpp",
- "query_solution.cpp",
- "stage_types.cpp",
+ 'expression_index_knobs.idl',
+ 'expression_index.cpp',
+ 'index_bounds_builder.cpp',
+ 'interval_evaluation_tree.cpp',
+ 'plan_cache_indexability.cpp',
+ 'plan_enumerator.cpp',
+ 'planner_access.cpp',
+ 'planner_analysis.cpp',
+ 'planner_ixselect.cpp',
+ 'planner_wildcard_helpers.cpp',
+ 'query_planner_common.cpp',
+ 'query_planner.cpp',
+ 'query_settings.cpp',
+ 'query_solution.cpp',
+ 'stage_types.cpp',
],
LIBDEPS=[
- "$BUILD_DIR/mongo/base",
- "$BUILD_DIR/mongo/db/catalog/clustered_collection_options",
- "$BUILD_DIR/mongo/db/commands/server_status_core",
- "$BUILD_DIR/mongo/db/exec/sbe/query_sbe_plan_stats",
- "$BUILD_DIR/mongo/db/index/expression_params",
- "$BUILD_DIR/mongo/db/index/key_generator",
- "$BUILD_DIR/mongo/db/index_names",
- "canonical_query",
- "query_index_bounds",
- "query_knobs",
- "query_plan_cache",
+ '$BUILD_DIR/mongo/db/catalog/clustered_collection_options',
+ '$BUILD_DIR/mongo/db/exec/sbe/query_sbe_plan_stats',
+ '$BUILD_DIR/mongo/db/index/expression_params',
+ 'canonical_query',
+ 'query_index_bounds',
+ 'query_knobs',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status_core',
'$BUILD_DIR/mongo/db/fts/base_fts',
- "$BUILD_DIR/mongo/db/record_id_helpers",
- "$BUILD_DIR/mongo/idl/server_parameter",
+ '$BUILD_DIR/mongo/db/index/key_generator',
+ '$BUILD_DIR/mongo/db/record_id_helpers',
+ '$BUILD_DIR/mongo/db/server_base',
+ '$BUILD_DIR/mongo/idl/server_parameter',
+ 'query_plan_cache',
],
)
@@ -179,9 +178,8 @@ env.Library(
source=[
'map_reduce_output_format.cpp',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/server_base',
],
)
@@ -192,8 +190,7 @@ env.Library(
'cursor_response.idl',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/basic_types',
'$BUILD_DIR/mongo/idl/idl_parser',
],
@@ -202,20 +199,18 @@ env.Library(
env.Library(
target='command_request_response',
source=[
- "analyze_command.idl",
- "count_command_as_aggregation_command.cpp",
- "count_request.cpp",
+ 'analyze_command.idl',
+ 'count_command_as_aggregation_command.cpp',
+ 'count_command.idl',
+ 'count_request.cpp',
'cursor_request.cpp',
'cursor_response.cpp',
- 'view_response_formatter.cpp',
- 'count_command.idl',
'kill_cursors.idl',
+ 'view_response_formatter.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/bson/util/bson_extract',
'$BUILD_DIR/mongo/db/common',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/ops/write_ops_parsers',
'$BUILD_DIR/mongo/db/query/hint_parser',
'$BUILD_DIR/mongo/db/repl/optime',
@@ -225,35 +220,36 @@ env.Library(
'query_request',
],
LIBDEPS_PRIVATE=[
- "cursor_response_idl",
+ '$BUILD_DIR/mongo/db/server_base',
+ 'cursor_response_idl',
],
)
env.Library(
- target="query_request",
+ target='query_request',
source=[
- "distinct_command.idl",
- "find_command.idl",
- "getmore_command.idl",
- "query_request_helper.cpp",
- "max_time_ms_parser.cpp",
- "tailable_mode.cpp",
- "tailable_mode.idl",
+ 'distinct_command.idl',
+ 'find_command.idl',
+ 'getmore_command.idl',
+ 'query_request_helper.cpp',
+ 'max_time_ms_parser.cpp',
+ 'tailable_mode.cpp',
+ 'tailable_mode.idl',
],
LIBDEPS=[
- "$BUILD_DIR/mongo/base",
- "$BUILD_DIR/mongo/crypto/fle_fields",
- "$BUILD_DIR/mongo/db/api_parameters",
+ '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/crypto/fle_fields',
+ '$BUILD_DIR/mongo/db/api_parameters',
'$BUILD_DIR/mongo/db/auth/authprivilege',
- "$BUILD_DIR/mongo/db/catalog/collection_catalog",
- "$BUILD_DIR/mongo/db/commands/test_commands_enabled",
- "$BUILD_DIR/mongo/db/namespace_string",
- "$BUILD_DIR/mongo/db/pipeline/runtime_constants_idl",
- "$BUILD_DIR/mongo/db/repl/read_concern_args",
- "hint_parser",
+ '$BUILD_DIR/mongo/db/catalog/collection_catalog',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ '$BUILD_DIR/mongo/db/pipeline/runtime_constants_idl',
+ '$BUILD_DIR/mongo/db/repl/read_concern_args',
+ 'hint_parser',
],
LIBDEPS_PRIVATE=[
- "cursor_response_idl",
+ '$BUILD_DIR/mongo/db/server_base',
+ 'cursor_response_idl',
],
)
diff --git a/src/mongo/db/query/ce/SConscript b/src/mongo/db/query/ce/SConscript
index 780f8cb8af1..7d550143025 100644
--- a/src/mongo/db/query/ce/SConscript
+++ b/src/mongo/db/query/ce/SConscript
@@ -17,6 +17,7 @@ env.Library(
'stats_cache_loader_impl.cpp',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/dbdirectclient',
'$BUILD_DIR/mongo/db/exec/sbe/query_sbe_abt',
'$BUILD_DIR/mongo/db/query/optimizer/optimizer',
],
@@ -58,13 +59,12 @@ env.CppUnitTest(
)
env.CppUnitTest(
- target="stats_cache_loader_test",
+ target='stats_cache_loader_test',
source=[
- "stats_cache_loader_test.cpp",
- "stats_cache_loader_test_fixture.cpp",
+ 'stats_cache_loader_test.cpp',
+ 'stats_cache_loader_test_fixture.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/authmocks',
'$BUILD_DIR/mongo/db/catalog/collection_crud',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
@@ -73,7 +73,6 @@ env.CppUnitTest(
'$BUILD_DIR/mongo/db/index_builds_coordinator_mongod',
'$BUILD_DIR/mongo/db/matcher/expressions',
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/op_observer/op_observer',
'$BUILD_DIR/mongo/db/op_observer/op_observer_impl',
'$BUILD_DIR/mongo/db/query/datetime/date_time_support',
@@ -84,6 +83,7 @@ env.CppUnitTest(
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/repl/replmocks',
'$BUILD_DIR/mongo/db/repl/storage_interface_impl',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/service_context_d_test_fixture',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index 0e9cc894058..fb3d63d7c58 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -352,8 +352,7 @@ env.Library(
'drop_pending_collection_reaper.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
'optime',
'storage_interface',
@@ -558,7 +557,6 @@ env.Library(
'oplog_entry.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/collection_options',
'$BUILD_DIR/mongo/db/exec/document_value/document_value',
'$BUILD_DIR/mongo/idl/idl_parser',
@@ -567,7 +565,7 @@ env.Library(
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_feature_flags',
],
)
@@ -590,10 +588,9 @@ env.Library(
'oplog_batcher.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/authorization_manager_global',
'$BUILD_DIR/mongo/db/db_raii',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/executor/task_executor_interface',
'$BUILD_DIR/mongo/util/concurrency/thread_pool',
'$BUILD_DIR/mongo/util/processinfo',
@@ -647,9 +644,8 @@ env.Library(
'oplog_entry_test_helpers.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/common',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/session/logical_session_id',
'oplog_entry',
'optime',
@@ -803,7 +799,7 @@ env.Library(
'replication_coordinator_noop.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/util/net/network',
'optime',
@@ -963,10 +959,8 @@ env.Library(
'oplog_fetcher.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/client/clientdriver_network',
'$BUILD_DIR/mongo/db/logical_time_metadata_hook',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/stats/counters',
'$BUILD_DIR/mongo/db/stats/timer_stats',
'$BUILD_DIR/mongo/executor/task_executor_interface',
@@ -979,6 +973,7 @@ env.Library(
'$BUILD_DIR/mongo/db/matcher/expressions',
'$BUILD_DIR/mongo/db/pipeline/pipeline',
'$BUILD_DIR/mongo/db/pipeline/process_interface/mongo_process_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'repl_server_parameters',
'replication_auth',
],
@@ -990,8 +985,7 @@ env.Library(
'reporter.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/executor/remote_command',
'$BUILD_DIR/mongo/executor/task_executor_interface',
'$BUILD_DIR/mongo/rpc/command_status',
@@ -1005,9 +999,8 @@ env.Library(
'sync_source_resolver.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/client/fetcher',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/executor/task_executor_interface',
'$BUILD_DIR/mongo/rpc/metadata',
'$BUILD_DIR/mongo/util/net/network',
@@ -1097,6 +1090,8 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/auth',
+ '$BUILD_DIR/mongo/db/server_base',
+ '$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/util/concurrency/thread_pool',
],
)
@@ -1207,12 +1202,9 @@ env.Library(
'database_cloner_common.cpp',
'database_cloner.idl',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- ],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/catalog/collection_options',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/idl/idl_parser',
'read_concern_args',
],
@@ -1371,8 +1363,8 @@ env.Library(
env.Library(
target='tenant_migration_utils',
source=[
- "tenant_migration_util.cpp",
- "tenant_migration_recipient_entry_helpers.cpp",
+ 'tenant_migration_util.cpp',
+ 'tenant_migration_recipient_entry_helpers.cpp',
],
LIBDEPS=[
'$BUILD_DIR/mongo/util/future_util',
@@ -1381,15 +1373,14 @@ env.Library(
'wait_for_majority_service',
],
LIBDEPS_PRIVATE=[
- "$BUILD_DIR/mongo/base",
- "$BUILD_DIR/mongo/db/catalog_raii",
- "$BUILD_DIR/mongo/db/concurrency/exception_util",
- "$BUILD_DIR/mongo/db/dbhelpers",
- "$BUILD_DIR/mongo/db/namespace_string",
- "$BUILD_DIR/mongo/db/ops/write_ops",
+ '$BUILD_DIR/mongo/db/catalog_raii',
+ '$BUILD_DIR/mongo/db/concurrency/exception_util',
+ '$BUILD_DIR/mongo/db/dbhelpers',
+ '$BUILD_DIR/mongo/db/ops/write_ops',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
- "$BUILD_DIR/mongo/db/storage/write_unit_of_work",
- "tenant_migration_state_machine_idl",
+ '$BUILD_DIR/mongo/db/storage/write_unit_of_work',
+ 'tenant_migration_state_machine_idl',
],
)
diff --git a/src/mongo/db/repl/oplog_test.cpp b/src/mongo/db/repl/oplog_test.cpp
index da6328fc8e5..d4e5a2295dd 100644
--- a/src/mongo/db/repl/oplog_test.cpp
+++ b/src/mongo/db/repl/oplog_test.cpp
@@ -27,8 +27,6 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include <algorithm>
#include <functional>
#include <map>
@@ -38,7 +36,6 @@
#include "mongo/db/client.h"
#include "mongo/db/concurrency/lock_manager_test_help.h"
#include "mongo/db/db_raii.h"
-#include "mongo/db/field_parser.h"
#include "mongo/db/repl/oplog.h"
#include "mongo/db/repl/oplog_entry.h"
#include "mongo/db/repl/oplog_interface_local.h"
@@ -50,7 +47,6 @@
#include "mongo/unittest/barrier.h"
#include "mongo/util/concurrency/thread_pool.h"
-
namespace mongo {
namespace repl {
namespace {
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript
index ca8ed158e11..37ef82773f3 100644
--- a/src/mongo/db/s/SConscript
+++ b/src/mongo/db/s/SConscript
@@ -30,15 +30,15 @@ env.Library(
'transaction_coordinator_worker_curop_repository.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/catalog/index_catalog',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
- '$BUILD_DIR/mongo/db/dbdirectclient',
'$BUILD_DIR/mongo/db/range_arithmetic',
- '$BUILD_DIR/mongo/db/repl/replica_set_aware_service',
'$BUILD_DIR/mongo/s/grid',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/catalog/index_catalog',
+ '$BUILD_DIR/mongo/db/concurrency/lock_manager',
+ '$BUILD_DIR/mongo/db/dbdirectclient',
+ '$BUILD_DIR/mongo/db/repl/replica_set_aware_service',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/write_block_bypass',
],
)
diff --git a/src/mongo/db/s/add_shard_util.cpp b/src/mongo/db/s/add_shard_util.cpp
index 957c2626e26..36151320805 100644
--- a/src/mongo/db/s/add_shard_util.cpp
+++ b/src/mongo/db/s/add_shard_util.cpp
@@ -37,9 +37,9 @@
#include "mongo/db/repl/repl_set_config.h"
#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/s/add_shard_cmd_gen.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/catalog/sharding_catalog_client.h"
#include "mongo/s/cluster_identity_loader.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/write_ops/batched_command_request.h"
namespace mongo {
diff --git a/src/mongo/db/s/balancer/balancer_commands_scheduler.h b/src/mongo/db/s/balancer/balancer_commands_scheduler.h
index bf2ad14bb7c..2c75d93e357 100644
--- a/src/mongo/db/s/balancer/balancer_commands_scheduler.h
+++ b/src/mongo/db/s/balancer/balancer_commands_scheduler.h
@@ -31,9 +31,9 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/db/s/balancer/balancer_policy.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor.h"
#include "mongo/s/request_types/move_range_request_gen.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/s/balancer/balancer_commands_scheduler_impl.cpp b/src/mongo/db/s/balancer/balancer_commands_scheduler_impl.cpp
index f2a2ca609dd..2e32bdd6808 100644
--- a/src/mongo/db/s/balancer/balancer_commands_scheduler_impl.cpp
+++ b/src/mongo/db/s/balancer/balancer_commands_scheduler_impl.cpp
@@ -32,12 +32,12 @@
#include "mongo/db/client.h"
#include "mongo/db/dbdirectclient.h"
#include "mongo/db/s/sharding_util.h"
+#include "mongo/db/shard_id.h"
#include "mongo/logv2/log.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/grid.h"
#include "mongo/s/request_types/migration_secondary_throttle_options.h"
#include "mongo/s/request_types/shardsvr_join_migrations_request_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/util/fail_point.h"
diff --git a/src/mongo/db/s/balancer/balancer_policy.h b/src/mongo/db/s/balancer/balancer_policy.h
index e88bc0a67fc..bd464ca9499 100644
--- a/src/mongo/db/s/balancer/balancer_policy.h
+++ b/src/mongo/db/s/balancer/balancer_policy.h
@@ -37,10 +37,10 @@
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/s/balancer/cluster_statistics.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/request_types/auto_split_vector_gen.h"
#include "mongo/s/request_types/move_range_request_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/shard_version.h"
namespace mongo {
diff --git a/src/mongo/db/s/balancer/cluster_statistics.h b/src/mongo/db/s/balancer/cluster_statistics.h
index 19bb44cc2b0..92dc21d3bc8 100644
--- a/src/mongo/db/s/balancer/cluster_statistics.h
+++ b/src/mongo/db/s/balancer/cluster_statistics.h
@@ -35,7 +35,7 @@
#include "mongo/base/status_with.h"
#include "mongo/db/namespace_string.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/s/config/config_server_test_fixture.cpp b/src/mongo/db/s/config/config_server_test_fixture.cpp
index eedeb9943a3..6b242634154 100644
--- a/src/mongo/db/s/config/config_server_test_fixture.cpp
+++ b/src/mongo/db/s/config/config_server_test_fixture.cpp
@@ -55,6 +55,7 @@
#include "mongo/db/repl/replication_coordinator_mock.h"
#include "mongo/db/s/config/sharding_catalog_manager.h"
#include "mongo/db/s/config_server_op_observer.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor_pool.h"
#include "mongo/executor/thread_pool_task_executor_test_fixture.h"
#include "mongo/rpc/metadata/repl_set_metadata.h"
@@ -70,7 +71,6 @@
#include "mongo/s/config_server_catalog_cache_loader.h"
#include "mongo/s/database_version.h"
#include "mongo/s/query/cluster_cursor_manager.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/write_ops/batched_command_response.h"
#include "mongo/util/clock_source_mock.h"
#include "mongo/util/tick_source_mock.h"
diff --git a/src/mongo/db/s/config/initial_split_policy.h b/src/mongo/db/s/config/initial_split_policy.h
index ed731ddaea0..563980f10d0 100644
--- a/src/mongo/db/s/config/initial_split_policy.h
+++ b/src/mongo/db/s/config/initial_split_policy.h
@@ -35,9 +35,9 @@
#include "mongo/db/catalog/collection_options.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/pipeline/pipeline.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/catalog/type_tags.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/util/string_map.h"
diff --git a/src/mongo/db/s/global_index/global_index_cloner_fetcher.h b/src/mongo/db/s/global_index/global_index_cloner_fetcher.h
index e6d803bfd60..192cd4988a3 100644
--- a/src/mongo/db/s/global_index/global_index_cloner_fetcher.h
+++ b/src/mongo/db/s/global_index/global_index_cloner_fetcher.h
@@ -32,7 +32,7 @@
#include "mongo/db/keypattern.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/pipeline/pipeline.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/util/future.h"
#include "mongo/util/uuid.h"
diff --git a/src/mongo/db/s/migration_destination_manager.h b/src/mongo/db/s/migration_destination_manager.h
index 5896fc00528..8a6ba36e5e1 100644
--- a/src/mongo/db/s/migration_destination_manager.h
+++ b/src/mongo/db/s/migration_destination_manager.h
@@ -42,9 +42,9 @@
#include "mongo/db/s/migration_recipient_recovery_document_gen.h"
#include "mongo/db/s/migration_session_id.h"
#include "mongo/db/s/session_catalog_migration_destination.h"
+#include "mongo/db/shard_id.h"
#include "mongo/platform/mutex.h"
#include "mongo/s/chunk_manager.h"
-#include "mongo/s/shard_id.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/cancellation.h"
diff --git a/src/mongo/db/s/move_primary_coordinator.cpp b/src/mongo/db/s/move_primary_coordinator.cpp
index 95f4b851cc5..a19a5ebb286 100644
--- a/src/mongo/db/s/move_primary_coordinator.cpp
+++ b/src/mongo/db/s/move_primary_coordinator.cpp
@@ -35,11 +35,11 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/s/move_primary_source_manager.h"
#include "mongo/db/s/sharding_state.h"
+#include "mongo/db/shard_id.h"
#include "mongo/db/write_block_bypass.h"
#include "mongo/logv2/log.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
-#include "mongo/s/shard_id.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding
diff --git a/src/mongo/db/s/move_primary_source_manager.h b/src/mongo/db/s/move_primary_source_manager.h
index cd678c95b19..dd6d3d0d03f 100644
--- a/src/mongo/db/s/move_primary_source_manager.h
+++ b/src/mongo/db/s/move_primary_source_manager.h
@@ -31,8 +31,8 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/db/s/database_sharding_state.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/request_types/move_primary_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/timer.h"
namespace mongo {
diff --git a/src/mongo/db/s/move_timing_helper.h b/src/mongo/db/s/move_timing_helper.h
index a90dd465090..e7f0de9ca2a 100644
--- a/src/mongo/db/s/move_timing_helper.h
+++ b/src/mongo/db/s/move_timing_helper.h
@@ -32,7 +32,7 @@
#include <string>
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/util/timer.h"
namespace mongo {
diff --git a/src/mongo/db/s/resharding/document_source_resharding_ownership_match.h b/src/mongo/db/s/resharding/document_source_resharding_ownership_match.h
index 7a6db2bc125..06c07a5a6f6 100644
--- a/src/mongo/db/s/resharding/document_source_resharding_ownership_match.h
+++ b/src/mongo/db/s/resharding/document_source_resharding_ownership_match.h
@@ -30,8 +30,8 @@
#pragma once
#include "mongo/db/pipeline/document_source.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/chunk_manager.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/shard_key_pattern.h"
namespace mongo {
diff --git a/src/mongo/db/s/resharding/resharding_collection_cloner.h b/src/mongo/db/s/resharding/resharding_collection_cloner.h
index 97e28a4fce5..7ad1b797658 100644
--- a/src/mongo/db/s/resharding/resharding_collection_cloner.h
+++ b/src/mongo/db/s/resharding/resharding_collection_cloner.h
@@ -37,7 +37,7 @@
#include "mongo/db/exec/document_value/value.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/pipeline/pipeline.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/util/cancellation.h"
#include "mongo/util/future.h"
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor.h b/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor.h
index aa3ff0727e9..7f396c627c1 100644
--- a/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor.h
+++ b/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor.h
@@ -34,8 +34,8 @@
#include "mongo/db/namespace_string.h"
#include "mongo/db/s/resharding/resharding_metrics.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/cancellation.h"
#include "mongo/util/duration.h"
#include "mongo/util/future.h"
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor_test.cpp b/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor_test.cpp
index ed4e41a63f2..11a54beed1e 100644
--- a/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_coordinator_commit_monitor_test.cpp
@@ -42,9 +42,9 @@
#include "mongo/db/s/resharding/resharding_coordinator_commit_monitor.h"
#include "mongo/db/s/resharding/resharding_metrics.h"
#include "mongo/db/s/resharding/resharding_server_parameters_gen.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/thread_pool_task_executor_test_fixture.h"
#include "mongo/logv2/log.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/cancellation.h"
#include "mongo/util/duration.h"
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_observer.cpp b/src/mongo/db/s/resharding/resharding_coordinator_observer.cpp
index 6899a54e4f7..b552bd9bbd5 100644
--- a/src/mongo/db/s/resharding/resharding_coordinator_observer.cpp
+++ b/src/mongo/db/s/resharding/resharding_coordinator_observer.cpp
@@ -37,9 +37,9 @@
#include "mongo/db/s/resharding/coordinator_document_gen.h"
#include "mongo/db/s/resharding/resharding_util.h"
#include "mongo/db/service_context.h"
+#include "mongo/db/shard_id.h"
#include "mongo/logv2/log.h"
#include "mongo/s/catalog/type_chunk.h"
-#include "mongo/s/shard_id.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kResharding
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_observer_test.cpp b/src/mongo/db/s/resharding/resharding_coordinator_observer_test.cpp
index bd893bd6dee..3a2764890a2 100644
--- a/src/mongo/db/s/resharding/resharding_coordinator_observer_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_coordinator_observer_test.cpp
@@ -34,8 +34,8 @@
#include "mongo/db/s/resharding/resharding_coordinator_observer.h"
#include "mongo/db/s/resharding/resharding_util.h"
+#include "mongo/db/shard_id.h"
#include "mongo/logv2/log.h"
-#include "mongo/s/shard_id.h"
#include "mongo/unittest/unittest.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kTest
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_service.cpp b/src/mongo/db/s/resharding/resharding_coordinator_service.cpp
index 55d1ced54d8..9afe2f6cb3a 100644
--- a/src/mongo/db/s/resharding/resharding_coordinator_service.cpp
+++ b/src/mongo/db/s/resharding/resharding_coordinator_service.cpp
@@ -51,6 +51,7 @@
#include "mongo/db/s/sharding_ddl_util.h"
#include "mongo/db/s/sharding_logging.h"
#include "mongo/db/session/logical_session_cache.h"
+#include "mongo/db/shard_id.h"
#include "mongo/db/storage/duplicate_key_error_info.h"
#include "mongo/db/vector_clock.h"
#include "mongo/db/write_concern_options.h"
@@ -64,7 +65,6 @@
#include "mongo/s/request_types/drop_collection_if_uuid_not_matching_gen.h"
#include "mongo/s/request_types/flush_resharding_state_change_gen.h"
#include "mongo/s/request_types/flush_routing_table_cache_updates_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/write_ops/batched_command_request.h"
#include "mongo/s/write_ops/batched_command_response.h"
#include "mongo/util/assert_util.h"
diff --git a/src/mongo/db/s/resharding/resharding_coordinator_service.h b/src/mongo/db/s/resharding/resharding_coordinator_service.h
index dcf221d1a3a..be08ef7ba9b 100644
--- a/src/mongo/db/s/resharding/resharding_coordinator_service.h
+++ b/src/mongo/db/s/resharding/resharding_coordinator_service.h
@@ -35,11 +35,11 @@
#include "mongo/db/s/resharding/resharding_coordinator_observer.h"
#include "mongo/db/s/resharding/resharding_metrics.h"
#include "mongo/db/service_context.h"
+#include "mongo/db/shard_id.h"
#include "mongo/platform/mutex.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/catalog/type_collection.h"
#include "mongo/s/catalog/type_tags.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/future.h"
namespace mongo {
diff --git a/src/mongo/db/s/resharding/resharding_data_replication.h b/src/mongo/db/s/resharding/resharding_data_replication.h
index 2e44a5d2a21..8d6659b65e5 100644
--- a/src/mongo/db/s/resharding/resharding_data_replication.h
+++ b/src/mongo/db/s/resharding/resharding_data_replication.h
@@ -37,9 +37,9 @@
#include "mongo/db/cancelable_operation_context.h"
#include "mongo/db/s/resharding/donor_oplog_id_gen.h"
#include "mongo/db/s/resharding/resharding_oplog_applier_metrics.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/chunk_manager.h"
#include "mongo/s/resharding/common_types_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/cancellation.h"
#include "mongo/util/functional.h"
#include "mongo/util/future.h"
diff --git a/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp b/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
index 51300394adc..0d901bd17dc 100644
--- a/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
@@ -42,13 +42,13 @@
#include "mongo/db/s/sharding_state.h"
#include "mongo/db/s/sharding_write_router.h"
#include "mongo/db/session/session_catalog_mongod.h"
+#include "mongo/db/shard_id.h"
#include "mongo/db/transaction/transaction_participant.h"
#include "mongo/s/catalog/sharding_catalog_client_mock.h"
#include "mongo/s/catalog/type_shard.h"
#include "mongo/s/catalog_cache_loader_mock.h"
#include "mongo/s/database_version.h"
#include "mongo/s/shard_cannot_refresh_due_to_locks_held_exception.h"
-#include "mongo/s/shard_id.h"
#include "mongo/unittest/unittest.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kTest
diff --git a/src/mongo/db/s/resharding/resharding_oplog_fetcher.h b/src/mongo/db/s/resharding/resharding_oplog_fetcher.h
index 37f5090f0e2..5e2e5d351ef 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_fetcher.h
+++ b/src/mongo/db/s/resharding/resharding_oplog_fetcher.h
@@ -39,9 +39,9 @@
#include "mongo/db/s/resharding/donor_oplog_id_gen.h"
#include "mongo/db/s/resharding/resharding_donor_oplog_iterator.h"
#include "mongo/db/service_context.h"
+#include "mongo/db/shard_id.h"
#include "mongo/platform/mutex.h"
#include "mongo/s/client/shard.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/background.h"
#include "mongo/util/cancellation.h"
#include "mongo/util/future.h"
diff --git a/src/mongo/db/s/resharding/resharding_recipient_service_external_state.h b/src/mongo/db/s/resharding/resharding_recipient_service_external_state.h
index 0a2749a66fc..d9ee5bbe574 100644
--- a/src/mongo/db/s/resharding/resharding_recipient_service_external_state.h
+++ b/src/mongo/db/s/resharding/resharding_recipient_service_external_state.h
@@ -36,8 +36,8 @@
#include "mongo/db/catalog/collection_options.h"
#include "mongo/db/s/migration_destination_manager.h"
#include "mongo/db/s/resharding/resharding_recipient_service.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/chunk_manager.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/s/resharding/resharding_util.h b/src/mongo/db/s/resharding/resharding_util.h
index 0d8aacbe3f7..6ed3319fecd 100644
--- a/src/mongo/db/s/resharding/resharding_util.h
+++ b/src/mongo/db/s/resharding/resharding_util.h
@@ -42,11 +42,11 @@
#include "mongo/db/s/resharding/coordinator_document_gen.h"
#include "mongo/db/s/resharding/donor_oplog_id_gen.h"
#include "mongo/db/s/sharding_state_lock.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor.h"
#include "mongo/s/catalog/type_tags.h"
#include "mongo/s/chunk_manager.h"
#include "mongo/s/resharding/common_types_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/db/s/resharding/resharding_util_test.cpp b/src/mongo/db/s/resharding/resharding_util_test.cpp
index 82e8180027e..69368692723 100644
--- a/src/mongo/db/s/resharding/resharding_util_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_util_test.cpp
@@ -44,8 +44,8 @@
#include "mongo/db/s/resharding/resharding_txn_cloner.h"
#include "mongo/db/s/resharding/resharding_util.h"
#include "mongo/db/session/session_txn_record_gen.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/catalog/type_shard.h"
-#include "mongo/s/shard_id.h"
#include "mongo/unittest/unittest.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kTest
diff --git a/src/mongo/db/s/session_catalog_migration_destination.cpp b/src/mongo/db/s/session_catalog_migration_destination.cpp
index 261458793b6..5ebc16ff05c 100644
--- a/src/mongo/db/s/session_catalog_migration_destination.cpp
+++ b/src/mongo/db/s/session_catalog_migration_destination.cpp
@@ -46,13 +46,13 @@
#include "mongo/db/s/session_catalog_migration.h"
#include "mongo/db/session/logical_session_id.h"
#include "mongo/db/session/session_catalog_mongod.h"
+#include "mongo/db/shard_id.h"
#include "mongo/db/transaction/transaction_participant.h"
#include "mongo/db/write_concern.h"
#include "mongo/logv2/log.h"
#include "mongo/logv2/redaction.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
-#include "mongo/s/shard_id.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding
diff --git a/src/mongo/db/s/session_catalog_migration_destination.h b/src/mongo/db/s/session_catalog_migration_destination.h
index 0dededc6699..94c223d85c1 100644
--- a/src/mongo/db/s/session_catalog_migration_destination.h
+++ b/src/mongo/db/s/session_catalog_migration_destination.h
@@ -36,8 +36,8 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/db/repl/oplog_entry.h"
#include "mongo/db/s/migration_session_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/platform/mutex.h"
-#include "mongo/s/shard_id.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/cancellation.h"
diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h
index e64ba436f17..65b766c943c 100644
--- a/src/mongo/db/s/sharding_state.h
+++ b/src/mongo/db/s/sharding_state.h
@@ -32,8 +32,8 @@
#include <string>
#include "mongo/bson/oid.h"
+#include "mongo/db/shard_id.h"
#include "mongo/platform/mutex.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/s/sharding_util.h b/src/mongo/db/s/sharding_util.h
index 90375723fd9..e968a3a5b7c 100644
--- a/src/mongo/db/s/sharding_util.h
+++ b/src/mongo/db/s/sharding_util.h
@@ -33,9 +33,9 @@
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor.h"
#include "mongo/s/async_requests_sender.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
namespace sharding_util {
diff --git a/src/mongo/db/s/sharding_util_refresh_test.cpp b/src/mongo/db/s/sharding_util_refresh_test.cpp
index bb2673be07c..d386ac55fa0 100644
--- a/src/mongo/db/s/sharding_util_refresh_test.cpp
+++ b/src/mongo/db/s/sharding_util_refresh_test.cpp
@@ -30,10 +30,10 @@
#include "mongo/client/remote_command_targeter_mock.h"
#include "mongo/db/s/config/config_server_test_fixture.h"
#include "mongo/db/s/sharding_util.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/thread_pool_task_executor_test_fixture.h"
#include "mongo/logv2/log.h"
#include "mongo/s/catalog/type_shard.h"
-#include "mongo/s/shard_id.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kTest
diff --git a/src/mongo/db/s/start_chunk_clone_request.h b/src/mongo/db/s/start_chunk_clone_request.h
index 9451541cbc0..3488776c007 100644
--- a/src/mongo/db/s/start_chunk_clone_request.h
+++ b/src/mongo/db/s/start_chunk_clone_request.h
@@ -35,8 +35,8 @@
#include "mongo/db/namespace_string.h"
#include "mongo/db/s/migration_session_id.h"
#include "mongo/db/session/logical_session_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/request_types/migration_secondary_throttle_options.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
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 1d8639988c9..0bfe77c5174 100644
--- a/src/mongo/db/s/start_chunk_clone_request_test.cpp
+++ b/src/mongo/db/s/start_chunk_clone_request_test.cpp
@@ -37,7 +37,7 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/service_context.h"
#include "mongo/db/session/logical_session_id_helpers.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
diff --git a/src/mongo/db/s/transaction_coordinator_futures_util.h b/src/mongo/db/s/transaction_coordinator_futures_util.h
index 5f6293e83a2..e48f5c5087a 100644
--- a/src/mongo/db/s/transaction_coordinator_futures_util.h
+++ b/src/mongo/db/s/transaction_coordinator_futures_util.h
@@ -33,10 +33,10 @@
#include <vector>
#include "mongo/client/read_preference.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor.h"
#include "mongo/executor/task_executor_pool.h"
#include "mongo/s/client/shard.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/concurrency/mutex.h"
#include "mongo/util/future.h"
#include "mongo/util/time_support.h"
diff --git a/src/mongo/db/s/transaction_coordinator_structures.h b/src/mongo/db/s/transaction_coordinator_structures.h
index af2bdb37a8d..b86be50ad56 100644
--- a/src/mongo/db/s/transaction_coordinator_structures.h
+++ b/src/mongo/db/s/transaction_coordinator_structures.h
@@ -34,7 +34,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
namespace mongo {
namespace txn {
diff --git a/src/mongo/db/s/transaction_coordinator_test_fixture.h b/src/mongo/db/s/transaction_coordinator_test_fixture.h
index 5c736a1ea40..62198ae4b73 100644
--- a/src/mongo/db/s/transaction_coordinator_test_fixture.h
+++ b/src/mongo/db/s/transaction_coordinator_test_fixture.h
@@ -35,7 +35,7 @@
#include "mongo/base/status.h"
#include "mongo/db/s/shard_server_test_fixture.h"
#include "mongo/db/s/transaction_coordinator.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
namespace mongo {
diff --git a/src/mongo/db/s/type_shard_database.idl b/src/mongo/db/s/type_shard_database.idl
index 27b370ac70e..823563e7ecc 100644
--- a/src/mongo/db/s/type_shard_database.idl
+++ b/src/mongo/db/s/type_shard_database.idl
@@ -52,7 +52,7 @@ structs:
description: "Primary shard for this database."
type: shard_id
validator:
- callback: "validateShardId"
+ callback: "ShardId::validate"
optional: false
# The following field has been deprecated in 6.0 and should not be used
# TODO SERVER-63983 make this field optional
diff --git a/src/mongo/db/serverless/SConscript b/src/mongo/db/serverless/SConscript
index 7ef92d52a51..d5095b1e091 100644
--- a/src/mongo/db/serverless/SConscript
+++ b/src/mongo/db/serverless/SConscript
@@ -77,10 +77,10 @@ env.Library(
'$BUILD_DIR/mongo/db/concurrency/exception_util',
'$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/dbhelpers',
- "$BUILD_DIR/mongo/db/index_builds_coordinator_interface",
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/index_builds_coordinator_interface',
'$BUILD_DIR/mongo/db/repl/oplog',
'$BUILD_DIR/mongo/db/repl/tenant_migration_access_blocker',
+ '$BUILD_DIR/mongo/db/server_base',
'shard_split_utils',
],
)
diff --git a/src/mongo/s/shard_id.cpp b/src/mongo/db/shard_id.cpp
index 385e25de253..39d66aa56a7 100644
--- a/src/mongo/s/shard_id.cpp
+++ b/src/mongo/db/shard_id.cpp
@@ -27,16 +27,10 @@
* it in the license file.
*/
-
-#include "mongo/platform/basic.h"
-
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include <functional>
-#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding
-
-
namespace mongo {
const ShardId ShardId::kConfigServerId("config");
@@ -45,6 +39,13 @@ bool ShardId::isValid() const {
return !_shardId.empty();
}
+Status ShardId::validate(const ShardId& value) {
+ if (!value.isValid()) {
+ return {ErrorCodes::NoSuchKey, "Shard ID cannot be empty"};
+ }
+ return Status::OK();
+}
+
int ShardId::compare(const ShardId& other) const {
return _shardId.compare(other._shardId);
}
diff --git a/src/mongo/s/shard_id.h b/src/mongo/db/shard_id.h
index af7276b84f6..798f8e427a1 100644
--- a/src/mongo/s/shard_id.h
+++ b/src/mongo/db/shard_id.h
@@ -70,6 +70,7 @@ public:
* Returns true if _shardId is not empty. Subject to include more validations in the future.
*/
bool isValid() const;
+ static Status validate(const ShardId& value);
/**
* Returns -1, 0, or 1 if 'this' is less, equal, or greater than 'other' in
diff --git a/src/mongo/s/shard_id_test.cpp b/src/mongo/db/shard_id_test.cpp
index 08765eeff91..542bdf206b4 100644
--- a/src/mongo/s/shard_id_test.cpp
+++ b/src/mongo/db/shard_id_test.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/base/string_data.h"
#include "mongo/platform/basic.h"
diff --git a/src/mongo/db/stats/SConscript b/src/mongo/db/stats/SConscript
index 524f8d897cb..7d07cadb4b4 100644
--- a/src/mongo/db/stats/SConscript
+++ b/src/mongo/db/stats/SConscript
@@ -116,9 +116,9 @@ env.Library(
env.Library(
target='serveronly_stats',
source=[
- "latency_server_status_section.cpp",
- "lock_server_status_section.cpp",
- "storage_stats.cpp",
+ 'latency_server_status_section.cpp',
+ 'lock_server_status_section.cpp',
+ 'storage_stats.cpp',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/base',
diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript
index 1bdc05203ab..86c58de6253 100644
--- a/src/mongo/db/storage/SConscript
+++ b/src/mongo/db/storage/SConscript
@@ -20,8 +20,7 @@ env.Library(
'index_entry_comparison.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'duplicate_key_error_info',
'key_string',
],
@@ -32,14 +31,11 @@ env.Library(
source=[
'snapshot_helper.cpp',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/namespace_string',
- ],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/concurrency/lock_manager_defs',
'$BUILD_DIR/mongo/db/repl/read_concern_args',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'recovery_unit_base',
],
)
@@ -121,13 +117,13 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/catalog/collection_options',
- '$BUILD_DIR/mongo/db/common',
- '$BUILD_DIR/mongo/db/service_context',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_options',
+ '$BUILD_DIR/mongo/db/service_context',
],
)
@@ -154,18 +150,15 @@ env.Library(
source=[
'oplog_cap_maintainer_thread.cpp',
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/db/namespace_string',
- '$BUILD_DIR/mongo/util/background_job',
- ],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/collection',
'$BUILD_DIR/mongo/db/catalog/collection_catalog',
'$BUILD_DIR/mongo/db/catalog/database_holder',
'$BUILD_DIR/mongo/db/catalog_raii',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
+ '$BUILD_DIR/mongo/util/background_job',
],
)
@@ -367,13 +360,12 @@ env.Library(
)
env.Library(
- target="historical_ident_tracker",
+ target='historical_ident_tracker',
source=[
- "historical_ident_tracker.cpp",
+ 'historical_ident_tracker.cpp',
],
LIBDEPS_PRIVATE=[
- "$BUILD_DIR/mongo/base",
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
],
)
@@ -506,7 +498,6 @@ env.CppUnitTest(
'storage_repair_observer_test.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/authmocks',
'$BUILD_DIR/mongo/db/catalog/catalog_impl',
'$BUILD_DIR/mongo/db/catalog/catalog_test_fixture',
@@ -515,9 +506,9 @@ env.CppUnitTest(
'$BUILD_DIR/mongo/db/concurrency/flow_control_ticketholder',
'$BUILD_DIR/mongo/db/dbhelpers',
'$BUILD_DIR/mongo/db/multitenancy',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/repl/replmocks',
'$BUILD_DIR/mongo/db/repl/topology_coordinator',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context_d_test_fixture',
'$BUILD_DIR/mongo/db/storage/devnull/storage_devnull_core',
'$BUILD_DIR/mongo/db/storage/durable_catalog_impl',
@@ -550,17 +541,16 @@ env.Library(
'$BUILD_DIR/mongo/db/catalog/collection_catalog',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/index/index_descriptor',
- '$BUILD_DIR/mongo/db/index_names',
- '$BUILD_DIR/mongo/db/namespace_string',
- '$BUILD_DIR/mongo/db/storage/bson_collection_catalog_entry',
+ 'bson_collection_catalog_entry',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/catalog/collection',
'$BUILD_DIR/mongo/db/multitenancy',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_options_core',
- '$BUILD_DIR/mongo/db/storage/storage_options',
'record_store_base',
+ 'storage_options',
],
)
@@ -606,9 +596,8 @@ env.Library(
'backup_block.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'historical_ident_tracker',
'storage_options',
],
diff --git a/src/mongo/db/storage/devnull/SConscript b/src/mongo/db/storage/devnull/SConscript
index 9a18906b3be..55f9caf314d 100644
--- a/src/mongo/db/storage/devnull/SConscript
+++ b/src/mongo/db/storage/devnull/SConscript
@@ -16,9 +16,8 @@ env.Library(
'$BUILD_DIR/mongo/db/storage/recovery_unit_base',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/collection_options',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/storage/backup_block',
],
)
diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript
index f322d6c6b92..7e21b13c355 100644
--- a/src/mongo/db/storage/wiredtiger/SConscript
+++ b/src/mongo/db/storage/wiredtiger/SConscript
@@ -48,7 +48,6 @@ wtEnv.Library(
'wiredtiger_parameters.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/bson/dotted_path_support',
'$BUILD_DIR/mongo/db/catalog/collection',
'$BUILD_DIR/mongo/db/catalog/collection_options',
@@ -56,7 +55,6 @@ wtEnv.Library(
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/global_settings',
'$BUILD_DIR/mongo/db/index/index_descriptor',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/prepare_conflict_tracker',
'$BUILD_DIR/mongo/db/record_id_helpers',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
@@ -85,6 +83,7 @@ wtEnv.Library(
'$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/mongod_options',
'$BUILD_DIR/mongo/db/multitenancy',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/snapshot_window_options',
'$BUILD_DIR/mongo/db/storage/backup_block',
'$BUILD_DIR/mongo/db/storage/storage_engine_parameters',
diff --git a/src/mongo/db/timeseries/SConscript b/src/mongo/db/timeseries/SConscript
index 3d0a6797307..8393765ccc1 100644
--- a/src/mongo/db/timeseries/SConscript
+++ b/src/mongo/db/timeseries/SConscript
@@ -33,7 +33,7 @@ env.Library(
'$BUILD_DIR/mongo/db/catalog/database_holder',
'$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/dbdirectclient',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/db/storage/storage_options',
'$BUILD_DIR/mongo/db/views/views',
@@ -76,9 +76,8 @@ env.Library(
'catalog_helper.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/collection_catalog',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'timeseries_options',
],
)
@@ -92,14 +91,12 @@ env.Library(
'timeseries_update_delete_util.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/bson/mutable/mutable_bson',
'$BUILD_DIR/mongo/bson/util/bson_column',
'$BUILD_DIR/mongo/db/exec/bucket_unpacker',
'$BUILD_DIR/mongo/db/index_commands_idl',
- '$BUILD_DIR/mongo/db/index_names',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/ops/write_ops_parsers',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/storage/storage_options',
'bucket_compression',
'timeseries_options',
@@ -112,12 +109,11 @@ env.Library(
'timeseries_collmod.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/bson/mutable/mutable_bson',
'$BUILD_DIR/mongo/db/catalog/catalog_helpers',
'$BUILD_DIR/mongo/db/coll_mod_command_idl',
'$BUILD_DIR/mongo/db/exec/bucket_unpacker',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'catalog_helper',
'timeseries_conversion_util',
'timeseries_options',
diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp
index e99259f6b35..c6381828e96 100644
--- a/src/mongo/db/write_concern_options.cpp
+++ b/src/mongo/db/write_concern_options.cpp
@@ -27,24 +27,18 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include <type_traits>
#include "mongo/db/write_concern_options.h"
-#include "mongo/db/write_concern_options_gen.h"
#include "mongo/base/status.h"
#include "mongo/base/string_data.h"
#include "mongo/bson/util/bson_extract.h"
-#include "mongo/db/field_parser.h"
#include "mongo/db/repl/repl_set_config.h"
+#include "mongo/db/write_concern_options_gen.h"
#include "mongo/util/str.h"
namespace mongo {
-
-using std::string;
-
namespace {
/**
diff --git a/src/mongo/idl/SConscript b/src/mongo/idl/SConscript
index b732a00dedf..9c3bf56494a 100644
--- a/src/mongo/idl/SConscript
+++ b/src/mongo/idl/SConscript
@@ -202,9 +202,8 @@ env.CppUnitTest(
'unittest_import.idl',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/authprivilege',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/idl/idl_parser',
diff --git a/src/mongo/logv2/SConscript b/src/mongo/logv2/SConscript
index cde87eda686..cf0725deb9e 100644
--- a/src/mongo/logv2/SConscript
+++ b/src/mongo/logv2/SConscript
@@ -12,9 +12,8 @@ env.CppUnitTest(
'redaction_test.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/security_token',
- '$BUILD_DIR/mongo/db/multitenancy_params',
+ '$BUILD_DIR/mongo/db/server_base',
],
)
diff --git a/src/mongo/rpc/SConscript b/src/mongo/rpc/SConscript
index d301f7e4db0..7747508771b 100644
--- a/src/mongo/rpc/SConscript
+++ b/src/mongo/rpc/SConscript
@@ -36,7 +36,6 @@ protoEnv.Library(
'op_msg.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/multitenancy',
'$BUILD_DIR/mongo/db/wire_version',
],
@@ -44,7 +43,7 @@ protoEnv.Library(
'$BUILD_DIR/mongo/bson/util/bson_extract',
'$BUILD_DIR/mongo/db/auth/security_token',
'$BUILD_DIR/mongo/db/bson/dotted_path_support',
- '$BUILD_DIR/mongo/db/multitenancy_params',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/third_party/wiredtiger/wiredtiger_checksum' if wiredtiger else [],
],
@@ -191,7 +190,7 @@ if wiredtiger:
'$BUILD_DIR/mongo/client/clientdriver_minimal',
'$BUILD_DIR/mongo/db/auth/auth',
'$BUILD_DIR/mongo/db/auth/authmocks',
- '$BUILD_DIR/mongo/db/multitenancy_params',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
'$BUILD_DIR/third_party/wiredtiger/wiredtiger_checksum',
'client_metadata',
diff --git a/src/mongo/rpc/write_concern_error_detail.cpp b/src/mongo/rpc/write_concern_error_detail.cpp
index 9e61408586e..b46962857b4 100644
--- a/src/mongo/rpc/write_concern_error_detail.cpp
+++ b/src/mongo/rpc/write_concern_error_detail.cpp
@@ -27,13 +27,10 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include "mongo/rpc/write_concern_error_detail.h"
-#include "mongo/rpc/write_concern_error_gen.h"
#include "mongo/bson/util/bson_extract.h"
-#include "mongo/db/field_parser.h"
+#include "mongo/rpc/write_concern_error_gen.h"
#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index 53ab148853c..a16d09e449d 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -190,7 +190,6 @@ env.Library(
'resharding/resume_token.idl',
'resharding/type_collection_fields.idl',
'shard_cannot_refresh_due_to_locks_held_exception.cpp',
- 'shard_id.cpp',
'shard_invalidated_for_targeting_exception.cpp',
'shard_version.cpp',
'shard_version.idl',
@@ -206,13 +205,13 @@ env.Library(
'$BUILD_DIR/mongo/db/commands/set_user_write_block_mode_idl',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/index_commands_idl',
- '$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/query/query_request',
'$BUILD_DIR/mongo/db/repl/optime',
'$BUILD_DIR/mongo/db/server_options',
'$BUILD_DIR/mongo/idl/idl_parser',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/timeseries/timeseries_options',
],
)
@@ -284,7 +283,9 @@ env.Library(
'$BUILD_DIR/mongo/client/clientdriver_network',
'$BUILD_DIR/mongo/db/logical_time_metadata_hook',
'$BUILD_DIR/mongo/db/matcher/expressions',
+ '$BUILD_DIR/mongo/db/mongohasher',
'$BUILD_DIR/mongo/db/query/query_planner',
+ '$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/storage/key_string',
'$BUILD_DIR/mongo/db/update/update_common',
'$BUILD_DIR/mongo/executor/task_executor_pool',
@@ -612,7 +613,6 @@ env.CppUnitTest(
'request_types/update_zone_key_range_request_test.cpp',
'routing_table_history_test.cpp',
'sessions_collection_sharded_test.cpp',
- 'shard_id_test.cpp',
'shard_key_pattern_test.cpp',
'shard_version_test.cpp',
'sharding_task_executor_test.cpp',
diff --git a/src/mongo/s/async_requests_sender.h b/src/mongo/s/async_requests_sender.h
index 27d22bc5511..f8952a8a3c0 100644
--- a/src/mongo/s/async_requests_sender.h
+++ b/src/mongo/s/async_requests_sender.h
@@ -37,11 +37,11 @@
#include "mongo/client/read_preference.h"
#include "mongo/db/baton.h"
#include "mongo/db/resource_yielder.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/remote_command_response.h"
#include "mongo/executor/scoped_task_executor.h"
#include "mongo/executor/task_executor.h"
#include "mongo/s/client/shard.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/interruptible.h"
#include "mongo/util/net/hostandport.h"
#include "mongo/util/producer_consumer_queue.h"
diff --git a/src/mongo/s/catalog/type_chunk.h b/src/mongo/s/catalog/type_chunk.h
index 30de46edf3a..fa1ad7a5ab9 100644
--- a/src/mongo/s/catalog/type_chunk.h
+++ b/src/mongo/s/catalog/type_chunk.h
@@ -35,9 +35,9 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/db/catalog/collection_options.h"
#include "mongo/db/namespace_string.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/catalog/type_chunk_base_gen.h"
#include "mongo/s/chunk_version.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/stdx/type_traits.h"
diff --git a/src/mongo/s/catalog/type_database.idl b/src/mongo/s/catalog/type_database.idl
index 15668ef486b..9f2fea34ada 100644
--- a/src/mongo/s/catalog/type_database.idl
+++ b/src/mongo/s/catalog/type_database.idl
@@ -52,7 +52,7 @@ structs:
description: "Primary shard for this database."
type: shard_id
validator:
- callback: "validateShardId"
+ callback: "ShardId::validate"
optional: false
# The following field has been deprecated in 6.0 and should not be used
# TODO SERVER-63983 make this field optional
diff --git a/src/mongo/s/catalog/type_shard.h b/src/mongo/s/catalog/type_shard.h
index 3038655f168..cc10535de03 100644
--- a/src/mongo/s/catalog/type_shard.h
+++ b/src/mongo/s/catalog/type_shard.h
@@ -35,7 +35,7 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/namespace_string.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
namespace mongo {
diff --git a/src/mongo/s/catalog/types_validators.h b/src/mongo/s/catalog/types_validators.h
index cded608aaaf..3f947e04d7c 100644
--- a/src/mongo/s/catalog/types_validators.h
+++ b/src/mongo/s/catalog/types_validators.h
@@ -29,7 +29,10 @@
#pragma once
-#include "mongo/s/shard_id.h"
+#include <string>
+
+#include "mongo/base/status.h"
+#include "mongo/base/string_data.h"
namespace mongo {
@@ -40,11 +43,4 @@ inline Status validateDatabaseName(const std::string& value) {
return Status::OK();
}
-inline Status validateShardId(const ShardId& value) {
- if (!value.isValid()) {
- return {ErrorCodes::NoSuchKey, "Shard ID cannot be empty"};
- }
- return Status::OK();
-}
-
} // namespace mongo
diff --git a/src/mongo/s/client/shard.h b/src/mongo/s/client/shard.h
index bb30a2903f3..72ed02043cb 100644
--- a/src/mongo/s/client/shard.h
+++ b/src/mongo/s/client/shard.h
@@ -39,8 +39,8 @@
#include "mongo/db/pipeline/aggregation_request_helper.h"
#include "mongo/db/repl/optime.h"
#include "mongo/db/repl/read_concern_args.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/remote_command_response.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/write_ops/batched_command_request.h"
#include "mongo/s/write_ops/batched_command_response.h"
diff --git a/src/mongo/s/client/shard_remote_test.cpp b/src/mongo/s/client/shard_remote_test.cpp
index e9d597856be..0b4d8f1116b 100644
--- a/src/mongo/s/client/shard_remote_test.cpp
+++ b/src/mongo/s/client/shard_remote_test.cpp
@@ -27,8 +27,6 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include "mongo/client/connection_string.h"
#include "mongo/db/logical_time.h"
#include "mongo/db/query/cursor_response.h"
@@ -38,7 +36,6 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/client/shard_remote.h"
#include "mongo/s/query/establish_cursors.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/sharding_router_test_fixture.h"
namespace mongo {
diff --git a/src/mongo/s/cluster_commands_helpers.cpp b/src/mongo/s/cluster_commands_helpers.cpp
index 3c4c12ff386..6f3a52b7b1a 100644
--- a/src/mongo/s/cluster_commands_helpers.cpp
+++ b/src/mongo/s/cluster_commands_helpers.cpp
@@ -45,6 +45,7 @@
#include "mongo/db/query/collation/collator_factory_interface.h"
#include "mongo/db/query/cursor_response.h"
#include "mongo/db/repl/read_concern_args.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor_pool.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/rpc/write_concern_error_detail.h"
@@ -55,7 +56,6 @@
#include "mongo/s/grid.h"
#include "mongo/s/multi_statement_transaction_requests_sender.h"
#include "mongo/s/request_types/sharded_ddl_commands_gen.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/stale_exception.h"
#include "mongo/s/transaction_router.h"
#include "mongo/util/scopeguard.h"
diff --git a/src/mongo/s/query/async_results_merger_params.idl b/src/mongo/s/query/async_results_merger_params.idl
index 6588058ffe2..d9a0e959238 100644
--- a/src/mongo/s/query/async_results_merger_params.idl
+++ b/src/mongo/s/query/async_results_merger_params.idl
@@ -29,7 +29,7 @@
global:
cpp_namespace: "mongo"
cpp_includes:
- - "mongo/s/shard_id.h"
+ - "mongo/db/shard_id.h"
- "mongo/util/net/hostandport.h"
- "mongo/db/query/cursor_response.h"
diff --git a/src/mongo/s/query/cluster_aggregation_planner.cpp b/src/mongo/s/query/cluster_aggregation_planner.cpp
index 0c80b838544..eb49ea8e422 100644
--- a/src/mongo/s/query/cluster_aggregation_planner.cpp
+++ b/src/mongo/s/query/cluster_aggregation_planner.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/pipeline/document_source_skip.h"
#include "mongo/db/pipeline/sharded_agg_helpers.h"
#include "mongo/db/query/find_common.h"
+#include "mongo/db/shard_id.h"
#include "mongo/logv2/log.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/rpc/op_msg_rpc_impls.h"
@@ -55,7 +56,6 @@
#include "mongo/s/query/router_stage_remove_metadata_fields.h"
#include "mongo/s/query/router_stage_skip.h"
#include "mongo/s/query/store_possible_cursor.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/s/transaction_router.h"
diff --git a/src/mongo/s/query/store_possible_cursor.cpp b/src/mongo/s/query/store_possible_cursor.cpp
index 329d47e34db..fcd1a89dd3d 100644
--- a/src/mongo/s/query/store_possible_cursor.cpp
+++ b/src/mongo/s/query/store_possible_cursor.cpp
@@ -36,12 +36,12 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/curop.h"
#include "mongo/db/query/cursor_response.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/task_executor_pool.h"
#include "mongo/s/grid.h"
#include "mongo/s/query/cluster_client_cursor_impl.h"
#include "mongo/s/query/cluster_client_cursor_params.h"
#include "mongo/s/query/cluster_cursor_manager.h"
-#include "mongo/s/shard_id.h"
#include "mongo/s/transaction_router.h"
namespace mongo {
diff --git a/src/mongo/s/query/store_possible_cursor.h b/src/mongo/s/query/store_possible_cursor.h
index a80302bc17d..8695ea9c150 100644
--- a/src/mongo/s/query/store_possible_cursor.h
+++ b/src/mongo/s/query/store_possible_cursor.h
@@ -33,8 +33,8 @@
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/query/tailable_mode.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/query/owned_remote_cursor.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
diff --git a/src/mongo/s/remote_command_shard_targeter.h b/src/mongo/s/remote_command_shard_targeter.h
index 3a1511b6465..fdebd7df570 100644
--- a/src/mongo/s/remote_command_shard_targeter.h
+++ b/src/mongo/s/remote_command_shard_targeter.h
@@ -35,9 +35,9 @@
#include "mongo/db/operation_context.h"
#include "mongo/db/s/operation_sharding_state.h"
#include "mongo/db/service_context.h"
+#include "mongo/db/shard_id.h"
#include "mongo/executor/remote_command_targeter.h"
#include "mongo/s/grid.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/assert_util_core.h"
#include "mongo/util/future.h"
diff --git a/src/mongo/s/remote_command_shard_targeter_test.cpp b/src/mongo/s/remote_command_shard_targeter_test.cpp
index 1dc6bebd3d9..6a97c8a104e 100644
--- a/src/mongo/s/remote_command_shard_targeter_test.cpp
+++ b/src/mongo/s/remote_command_shard_targeter_test.cpp
@@ -32,7 +32,7 @@
#include "mongo/base/error_codes.h"
#include "mongo/client/read_preference.h"
-#include "mongo/s/shard_id.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/sharding_initialization.h"
#include "mongo/s/sharding_router_test_fixture.h"
#include "mongo/s/sharding_test_fixture_common.h"
diff --git a/src/mongo/s/request_types/balance_chunk_request_type.h b/src/mongo/s/request_types/balance_chunk_request_type.h
index 1eff27a0b2d..e28d6b3bfcd 100644
--- a/src/mongo/s/request_types/balance_chunk_request_type.h
+++ b/src/mongo/s/request_types/balance_chunk_request_type.h
@@ -31,9 +31,9 @@
#include <boost/optional.hpp>
+#include "mongo/db/shard_id.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/request_types/migration_secondary_throttle_options.h"
-#include "mongo/s/shard_id.h"
namespace mongo {
diff --git a/src/mongo/s/request_types/move_range_request.idl b/src/mongo/s/request_types/move_range_request.idl
index b86236b0467..6fccb39678a 100644
--- a/src/mongo/s/request_types/move_range_request.idl
+++ b/src/mongo/s/request_types/move_range_request.idl
@@ -63,7 +63,7 @@ structs:
type: shard_id
description: "ID of the recipient shard"
validator:
- callback: "validateShardId"
+ callback: "ShardId::validate"
min:
type: object_owned
description: "The min key of the range to move"
@@ -137,7 +137,7 @@ commands:
type: shard_id
description: "ID of the donor shard"
validator:
- callback: "validateShardId"
+ callback: "ShardId::validate"
maxChunkSizeBytes:
type: safeInt64
description: "Max size of data to move"
diff --git a/src/mongo/s/sharding_types.idl b/src/mongo/s/sharding_types.idl
index 0c09974412c..06b7116f7fe 100644
--- a/src/mongo/s/sharding_types.idl
+++ b/src/mongo/s/sharding_types.idl
@@ -31,7 +31,7 @@
global:
cpp_namespace: "mongo"
cpp_includes:
- - "mongo/s/shard_id.h"
+ - "mongo/db/shard_id.h"
- "mongo/s/database_version.h"
imports:
diff --git a/src/mongo/s/stale_exception.h b/src/mongo/s/stale_exception.h
index 3372efd20b2..5a19f6db95c 100644
--- a/src/mongo/s/stale_exception.h
+++ b/src/mongo/s/stale_exception.h
@@ -30,9 +30,9 @@
#pragma once
#include "mongo/db/namespace_string.h"
+#include "mongo/db/shard_id.h"
#include "mongo/s/chunk_version.h"
#include "mongo/s/database_version.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/concurrency/notification.h"
namespace mongo {
diff --git a/src/mongo/s/stale_exception_test.cpp b/src/mongo/s/stale_exception_test.cpp
index 57cb2b89062..67d857a0ca5 100644
--- a/src/mongo/s/stale_exception_test.cpp
+++ b/src/mongo/s/stale_exception_test.cpp
@@ -27,7 +27,6 @@
* it in the license file.
*/
-#include "mongo/s/shard_id.h"
#include "mongo/s/stale_exception.h"
#include "mongo/unittest/unittest.h"
diff --git a/src/mongo/s/transaction_router.h b/src/mongo/s/transaction_router.h
index 09af7b2e788..0a68361ebe4 100644
--- a/src/mongo/s/transaction_router.h
+++ b/src/mongo/s/transaction_router.h
@@ -37,10 +37,10 @@
#include "mongo/db/repl/read_concern_args.h"
#include "mongo/db/session/logical_session_id.h"
#include "mongo/db/session/session_catalog.h"
+#include "mongo/db/shard_id.h"
#include "mongo/db/stats/single_transaction_stats.h"
#include "mongo/s/async_requests_sender.h"
#include "mongo/s/client/shard.h"
-#include "mongo/s/shard_id.h"
#include "mongo/util/string_map.h"
namespace mongo {