summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2018-03-15 16:50:29 -0400
committerHenrik Edin <henrik.edin@mongodb.com>2018-03-23 11:47:39 -0400
commit49138e688e51b8397bc32d8c875ea10ef968af4c (patch)
tree6226316e9ceb4ebada810e832ea4acbdbd8277c3 /src
parente06bf692e42a84eae9f74001d7f5677b91c26cad (diff)
downloadmongo-49138e688e51b8397bc32d8c875ea10ef968af4c.tar.gz
SERVER-33889 Split dcommands and core into libraries for embedded vs standalone process applications. Refactored commands libraries throughout the codebase and made their uses be LIBDEPS_PRIVATE when possible as most commands don't export any symbols and don't even have headerfiles.
Diffstat (limited to 'src')
-rw-r--r--src/mongo/SConscript8
-rw-r--r--src/mongo/client/SConscript4
-rw-r--r--src/mongo/client/dbclient.cpp1
-rw-r--r--src/mongo/client/embedded/SConscript5
-rw-r--r--src/mongo/db/SConscript28
-rw-r--r--src/mongo/db/auth/SConscript64
-rw-r--r--src/mongo/db/auth/sasl_mechanism_registry.h1
-rw-r--r--src/mongo/db/commands.h1
-rw-r--r--src/mongo/db/commands/SConscript174
-rw-r--r--src/mongo/db/commands/authentication_commands.cpp1
-rw-r--r--src/mongo/db/commands/cpuload.cpp1
-rw-r--r--src/mongo/db/commands/dbcheck.cpp1
-rw-r--r--src/mongo/db/commands/fail_point_cmd.cpp1
-rw-r--r--src/mongo/db/commands/generic.cpp1
-rw-r--r--src/mongo/db/commands/hashcmd.cpp1
-rw-r--r--src/mongo/db/commands/reap_logical_session_cache_now.cpp1
-rw-r--r--src/mongo/db/commands/refresh_logical_session_cache_now.cpp1
-rw-r--r--src/mongo/db/commands/restart_catalog_command.cpp1
-rw-r--r--src/mongo/db/commands/snapshot_management.cpp1
-rw-r--r--src/mongo/db/commands/test_commands.cpp1
-rw-r--r--src/mongo/db/commands/txn_cmds.cpp1
-rw-r--r--src/mongo/db/exec/SConscript3
-rw-r--r--src/mongo/db/exec/stagedebug_cmd.cpp1
-rw-r--r--src/mongo/db/pipeline/SConscript3
-rw-r--r--src/mongo/db/pipeline/document_source_list_local_cursors.cpp1
-rw-r--r--src/mongo/db/repl/SConscript55
-rw-r--r--src/mongo/db/repl/bgsync.cpp1
-rw-r--r--src/mongo/db/repl/noop_writer.cpp1
-rw-r--r--src/mongo/db/repl/repl_set_commands.cpp1
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp1
-rw-r--r--src/mongo/db/s/SConscript14
-rw-r--r--src/mongo/db/s/config/configsvr_shard_collection_command.cpp1
-rw-r--r--src/mongo/db/stats/SConscript4
-rw-r--r--src/mongo/db/storage/SConscript4
-rw-r--r--src/mongo/db/storage/mmap_v1/SConscript63
-rw-r--r--src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp1
-rw-r--r--src/mongo/db/storage/wiredtiger/SConscript2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp1
-rw-r--r--src/mongo/dbtests/SConscript2
-rw-r--r--src/mongo/dbtests/dbtests.cpp1
-rw-r--r--src/mongo/executor/SConscript7
-rw-r--r--src/mongo/executor/network_interface_asio_auth.cpp1
-rw-r--r--src/mongo/s/commands/SConscript10
-rw-r--r--src/mongo/s/commands/cluster_multicast.cpp1
-rw-r--r--src/mongo/s/commands/cluster_restart_catalog_command.cpp1
-rw-r--r--src/mongo/s/write_ops/SConscript4
-rw-r--r--src/mongo/util/SConscript4
47 files changed, 302 insertions, 184 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index 3d4fb782bd9..f0d931e5fcd 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -293,7 +293,8 @@ env.Library(
],
LIBDEPS_PRIVATE=[
'db/catalog/health_log',
- 'db/commands/core',
+ 'db/commands/mongod',
+ 'db/commands/mongod_fcv',
'db/dbdirectclient',
'db/ftdc/ftdc_mongod',
'db/index_d',
@@ -414,12 +415,14 @@ if not hygienic:
's/version_mongos.cpp',
] + env.WindowsResourceFile("s/server.rc"),
LIBDEPS=[
- 'db/commands/core',
+ 'db/auth/authmongos',
'db/commands/server_status',
+ 'db/curop',
'db/ftdc/ftdc_mongos',
'db/logical_time_metadata_hook',
'db/mongodandmongos',
'db/server_options',
+ 'db/startup_warnings_common',
'db/stats/counters',
's/client/sharding_connection_hook',
's/commands/cluster_commands',
@@ -429,6 +432,7 @@ if not hygienic:
's/is_mongos',
's/sharding_egress_metadata_hook_for_mongos',
's/sharding_initialization',
+ 's/query/cluster_cursor_cleanup_job',
'transport/service_entry_point',
'transport/transport_layer_manager',
'util/clock_sources',
diff --git a/src/mongo/client/SConscript b/src/mongo/client/SConscript
index 92785bdae90..9a679c36395 100644
--- a/src/mongo/client/SConscript
+++ b/src/mongo/client/SConscript
@@ -175,7 +175,6 @@ clientDriverEnv.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authcommon',
- '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/dbmessage',
'$BUILD_DIR/mongo/db/wire_version',
'$BUILD_DIR/mongo/db/write_concern_options',
@@ -193,6 +192,9 @@ clientDriverEnv.Library(
'connection_string',
'read_preference',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
)
env.CppIntegrationTest(
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp
index 60547965a65..90dc9388cf8 100644
--- a/src/mongo/client/dbclient.cpp
+++ b/src/mongo/client/dbclient.cpp
@@ -48,6 +48,7 @@
#include "mongo/db/auth/internal_user_auth.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/json.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/query/killcursors_request.h"
diff --git a/src/mongo/client/embedded/SConscript b/src/mongo/client/embedded/SConscript
index e0ed148d467..6945a14b5c0 100644
--- a/src/mongo/client/embedded/SConscript
+++ b/src/mongo/client/embedded/SConscript
@@ -80,8 +80,11 @@ env.Library(
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/authz_manager_external_state_factory_d',
'$BUILD_DIR/mongo/db/catalog/catalog_impl',
- '$BUILD_DIR/mongo/db/commands/dcommands',
+ '$BUILD_DIR/mongo/db/commands/fsync_locked',
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
+ '$BUILD_DIR/mongo/db/commands/standalone',
'$BUILD_DIR/mongo/db/dbdirectclient',
+ '$BUILD_DIR/mongo/db/log_process_details',
'$BUILD_DIR/mongo/db/op_observer_d',
'$BUILD_DIR/mongo/db/repair_database_and_check_version',
'$BUILD_DIR/mongo/db/repl/replication_info',
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 91344e17244..99287b19945 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -529,7 +529,6 @@ env.Library(
'auth/authcore',
'command_can_run_here',
'commands/server_status_core',
- 'commands/test_commands_enabled',
'service_context',
],
)
@@ -594,7 +593,6 @@ env.Library(
'catalog/database',
'catalog/database_holder',
'catalog/uuid_catalog',
- 'commands/server_status',
'concurrency/lock_manager',
'curop_metrics',
'dbdirectclient',
@@ -605,6 +603,9 @@ env.Library(
's/sharding_api_d',
'views/views',
],
+ LIBDEPS_PRIVATE=[
+ 'commands/server_status',
+ ]
)
env.CppUnitTest(
@@ -671,10 +672,11 @@ env.Library(
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/auth/authmongod',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
- '$BUILD_DIR/mongo/db/commands/dcommands_fsync',
'$BUILD_DIR/mongo/db/ops/write_ops_parsers',
'$BUILD_DIR/mongo/db/s/sharding',
'$BUILD_DIR/mongo/db/storage/storage_options',
+ '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
+ '$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
'$BUILD_DIR/mongo/transport/service_entry_point',
'command_can_run_here',
'curop',
@@ -711,6 +713,9 @@ env.Library(
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/uuid_catalog',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
+ ],
)
env.Library(
@@ -755,6 +760,8 @@ env.Library(
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/collection_options',
'$BUILD_DIR/mongo/db/catalog/index_create',
+ ],
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/commands/list_collections_filter',
],
)
@@ -765,7 +772,6 @@ env.Library(
"curop_metrics.cpp",
],
LIBDEPS=[
- "commands/server_status_core",
"curop",
],
)
@@ -803,6 +809,7 @@ env.Library(
LIBDEPS=[
'dbhelpers',
'index/index_access_method',
+ '$BUILD_DIR/mongo/db/stats/timer_stats',
'$BUILD_DIR/mongo/db/storage/mmap_v1/mmap',
],
)
@@ -1001,8 +1008,6 @@ env.Library(
"catalog/index_key_validate",
"cloner",
"collection_index_usage_tracker",
- "commands/dcommands",
- "commands/killcursors_common",
"common",
"concurrency/lock_manager",
"concurrency/write_conflict_exception",
@@ -1070,6 +1075,7 @@ env.Library(
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/catalog/catalog_helpers',
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
'dbdirectclient',
'dbhelpers',
'repair_database',
@@ -1262,12 +1268,14 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/s/client/sharding_client',
- '$BUILD_DIR/mongo/s/commands/shared_cluster_commands',
'$BUILD_DIR/mongo/s/coreshard',
'dbdirectclient',
'sessions_collection',
'sessions_collection_sharded',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/s/commands/shared_cluster_commands',
+ ]
)
env.Library(
@@ -1291,7 +1299,6 @@ env.Library(
env.Idlc('commands/end_sessions.idl')[0],
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands/server_status',
'logical_session_cache',
'logical_session_id',
'logical_session_id_helpers',
@@ -1300,6 +1307,9 @@ env.Library(
'service_liason',
'kill_sessions',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
+ ]
)
env.Library(
@@ -1308,7 +1318,6 @@ env.Library(
'transaction_reaper.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/s/client/shard_interface',
'$BUILD_DIR/mongo/s/coreshard',
@@ -1623,6 +1632,7 @@ env.Library(
'service_context_d_test_fixture.cpp',
],
LIBDEPS= [
+ '$BUILD_DIR/mongo/db/commands/mongod',
'$BUILD_DIR/mongo/db/serveronly',
'$BUILD_DIR/mongo/db/storage/storage_options',
'$BUILD_DIR/mongo/unittest/unittest',
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index a13216efbb2..e3afcfc79d9 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -136,20 +136,27 @@ env.Library(
],
)
-env.Library('authservercommon',
- [
- 'authz_session_external_state_server_common.cpp',
- 'sasl_commands.cpp',
- 'security_key.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands/core',
- 'authcommon',
- 'authcore',
- 'authorization_manager_global',
- 'saslauth',
- 'security_file',
- ])
+env.Library(
+ target='authservercommon',
+ source=[
+ 'authz_session_external_state_server_common.cpp',
+ 'sasl_commands.cpp',
+ 'security_key.cpp',
+ ],
+ LIBDEPS=[
+ 'authcommon',
+ 'authcore',
+ 'authorization_manager_global',
+ 'saslauth',
+ 'security_file',
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/client/sasl_client',
+ '$BUILD_DIR/mongo/db/commands',
+ '$BUILD_DIR/mongo/db/commands/servers',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ]
+)
env.Library('security_file',
['security_file.cpp'],
@@ -167,20 +174,21 @@ env.Library('sasl_options',
],
)
-env.Library('saslauth',
- [
- 'sasl_mechanism_registry.cpp',
- 'sasl_plain_server_conversation.cpp',
- 'sasl_scram_server_conversation.cpp',
- ],
- LIBDEPS=[
- 'authcore',
- 'sasl_options',
- '$BUILD_DIR/mongo/base/secure_allocator',
- '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
- '$BUILD_DIR/mongo/util/icu',
- '$BUILD_DIR/mongo/util/net/network',
- ],
+env.Library(
+ target='saslauth',
+ source=[
+ 'sasl_mechanism_registry.cpp',
+ 'sasl_plain_server_conversation.cpp',
+ 'sasl_scram_server_conversation.cpp',
+ ],
+ LIBDEPS=[
+ 'authcore',
+ 'sasl_options',
+ '$BUILD_DIR/mongo/base/secure_allocator',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ '$BUILD_DIR/mongo/util/icu',
+ '$BUILD_DIR/mongo/util/net/network',
+ ],
)
env.CppUnitTest(target='sasl_mechanism_registry_test',
diff --git a/src/mongo/db/auth/sasl_mechanism_registry.h b/src/mongo/db/auth/sasl_mechanism_registry.h
index bd9343296c4..ee10fd4cc4b 100644
--- a/src/mongo/db/auth/sasl_mechanism_registry.h
+++ b/src/mongo/db/auth/sasl_mechanism_registry.h
@@ -34,6 +34,7 @@
#include "mongo/base/string_data.h"
#include "mongo/db/auth/authorization_manager.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index 0401c232fa2..01e8a41ffbb 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -39,7 +39,6 @@
#include "mongo/db/auth/resource_pattern.h"
#include "mongo/db/client.h"
#include "mongo/db/commands/server_status_metric.h"
-#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/query/explain.h"
#include "mongo/db/repl/read_concern_args.h"
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index 4bdfa97fbfe..b07fd756abf 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -64,100 +64,94 @@ env.Library(
],
)
+# Commands available in every process that executes commands
env.Library(
target="core",
source=[
+ "copydb_common.cpp",
+ "fail_point_cmd.cpp",
+ "find_and_modify_common.cpp",
+ "generic.cpp",
+ "hashcmd.cpp",
+ "parameters.cpp",
+ "rename_collection_common.cpp",
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ '$BUILD_DIR/mongo/db/common',
+ '$BUILD_DIR/mongo/db/log_process_details',
+ '$BUILD_DIR/mongo/logger/parse_log_component_settings',
+ '$BUILD_DIR/mongo/scripting/scripting_common',
+ '$BUILD_DIR/mongo/util/ntservice',
+ ],
+)
+
+# Commands available in all mongodb server processes (mongod, mongos, etc.)
+env.Library(
+ target="servers",
+ source=[
"authentication_commands.cpp",
"conn_pool_stats.cpp",
"conn_pool_sync.cpp",
"connection_status.cpp",
- "copydb_common.cpp",
"end_sessions_command.cpp",
- "fail_point_cmd.cpp",
"feature_compatibility_version_command_parser.cpp",
- "find_and_modify_common.cpp",
- "generic.cpp",
- "hashcmd.cpp",
"isself.cpp",
"kill_all_sessions_by_pattern_command.cpp",
"kill_all_sessions_command.cpp",
"kill_sessions_command.cpp",
"mr_common.cpp",
- "parameters.cpp",
"reap_logical_session_cache_now.cpp",
"refresh_logical_session_cache_now.cpp",
"refresh_sessions_command.cpp",
"refresh_sessions_command_internal.cpp",
- "rename_collection_common.cpp",
"start_session_command.cpp",
"user_management_commands_common.cpp",
],
- LIBDEPS=[
- '$BUILD_DIR/mongo/client/clientdriver',
- '$BUILD_DIR/mongo/db/audit',
- '$BUILD_DIR/mongo/db/auth/authcommon',
- '$BUILD_DIR/mongo/db/auth/authorization_manager_global',
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/commands',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/common',
- '$BUILD_DIR/mongo/db/curop',
- '$BUILD_DIR/mongo/db/exec/working_set',
- '$BUILD_DIR/mongo/db/index/key_generator',
- '$BUILD_DIR/mongo/db/index_names',
+ '$BUILD_DIR/mongo/client/clientdriver',
'$BUILD_DIR/mongo/db/kill_sessions',
- '$BUILD_DIR/mongo/db/lasterror',
- '$BUILD_DIR/mongo/db/log_process_details',
'$BUILD_DIR/mongo/db/logical_session_cache',
'$BUILD_DIR/mongo/db/logical_session_cache_impl',
'$BUILD_DIR/mongo/db/logical_session_id',
'$BUILD_DIR/mongo/db/logical_session_id_helpers',
- '$BUILD_DIR/mongo/db/matcher/expressions',
'$BUILD_DIR/mongo/db/repl/isself',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
- '$BUILD_DIR/mongo/db/server_options',
- '$BUILD_DIR/mongo/db/server_parameters',
- '$BUILD_DIR/mongo/db/startup_warnings_common',
- '$BUILD_DIR/mongo/db/stats/counters',
- '$BUILD_DIR/mongo/db/stats/timer_stats',
- '$BUILD_DIR/mongo/db/views/views',
- '$BUILD_DIR/mongo/logger/parse_log_component_settings',
+ '$BUILD_DIR/mongo/executor/task_executor_pool',
'$BUILD_DIR/mongo/s/sharding_legacy_api',
'$BUILD_DIR/mongo/s/coreshard',
- '$BUILD_DIR/mongo/s/write_ops/batch_write_types',
- '$BUILD_DIR/mongo/scripting/scripting_common',
- '$BUILD_DIR/mongo/transport/message_compressor',
- '$BUILD_DIR/mongo/transport/transport_layer_common',
- '$BUILD_DIR/mongo/util/cmdline_utils/cmdline_utils',
- '$BUILD_DIR/mongo/util/ntservice',
- '$BUILD_DIR/mongo/util/processinfo',
+ 'core',
'feature_compatibility_version_parser',
- 'server_status_core',
- ],
+ ]
)
env.Library(
- target="dcommands_fsync",
+ target="mongod_fsync",
source=[
"fsync.cpp",
],
- LIBDEPS=[
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/commands',
'$BUILD_DIR/mongo/db/concurrency/write_conflict_exception',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/storage/mmap_v1/storage_mmapv1',
- ],
- LIBDEPS_PRIVATE=[
'fsync_locked',
]
)
env.Library(
- target="dcommands_fcv",
+ target="mongod_fcv",
source=[
"feature_compatibility_version.cpp",
],
LIBDEPS=[
- 'core',
+ 'feature_compatibility_version_parser',
+ ],
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/commands',
'$BUILD_DIR/mongo/db/dbdirectclient',
],
@@ -172,77 +166,55 @@ env.Library(
],
)
-# Commands that should only be present in mongod
+# Commands that are present in both mongod and embedded
env.Library(
- target="dcommands",
+ target="standalone",
source=[
- "apply_ops_cmd.cpp",
"clone.cpp",
"clone_collection.cpp",
"collection_to_capped.cpp",
- "compact.cpp",
"copydb.cpp",
"copydb_start_commands.cpp",
"count_cmd.cpp",
- "cpuload.cpp",
"create_indexes.cpp",
"current_op.cpp",
"dbcheck.cpp",
"dbcommands.cpp",
"dbhash.cpp",
"distinct.cpp",
- "do_txn_cmd.cpp",
"driverHelpers.cpp",
"drop_indexes.cpp",
- "eval.cpp",
"explain_cmd.cpp",
"find_and_modify.cpp",
"find_cmd.cpp",
"geo_near_cmd.cpp",
"get_last_error.cpp",
"getmore_cmd.cpp",
- "group_cmd.cpp",
- "haystack.cpp",
"index_filter_commands.cpp",
- "kill_op.cpp",
"killcursors_cmd.cpp",
+ "lock_info.cpp",
"list_collections.cpp",
"list_databases.cpp",
"list_indexes.cpp",
- "lock_info.cpp",
- "mr.cpp",
- "oplog_application_checks.cpp",
- "oplog_note.cpp",
- "parallel_collection_scan.cpp",
"pipeline_command.cpp",
"plan_cache_commands.cpp",
"rename_collection_cmd.cpp",
"repair_cursor.cpp",
- "resize_oplog.cpp",
- "restart_catalog_command.cpp",
"run_aggregate.cpp",
- "set_feature_compatibility_version_command.cpp",
- "snapshot_management.cpp",
- "test_commands.cpp",
- "top_command.cpp",
- "touch.cpp",
- "txn_cmds.cpp",
- "user_management_commands.cpp",
"validate.cpp",
"write_commands/write_commands.cpp",
],
- LIBDEPS=[
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/client/clientdriver',
- '$BUILD_DIR/mongo/db/auth/authmongod',
- '$BUILD_DIR/mongo/db/background',
+ '$BUILD_DIR/mongo/db/commands',
+ '$BUILD_DIR/mongo/db/ops/write_ops_exec',
'$BUILD_DIR/mongo/db/catalog/catalog_helpers',
'$BUILD_DIR/mongo/db/catalog/catalog_impl',
'$BUILD_DIR/mongo/db/catalog/collection',
'$BUILD_DIR/mongo/db/catalog/index_key_validate',
'$BUILD_DIR/mongo/db/cloner',
'$BUILD_DIR/mongo/db/command_can_run_here',
- '$BUILD_DIR/mongo/db/commands',
'$BUILD_DIR/mongo/db/exec/stagedebug_cmd',
'$BUILD_DIR/mongo/db/index/index_access_method',
'$BUILD_DIR/mongo/db/index_d',
@@ -252,25 +224,68 @@ env.Library(
'$BUILD_DIR/mongo/db/repair_database',
'$BUILD_DIR/mongo/db/repl/dbcheck',
'$BUILD_DIR/mongo/db/repl/isself',
- '$BUILD_DIR/mongo/db/repl/oplog',
- '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/rw_concern_d',
- '$BUILD_DIR/mongo/db/s/sharding_catalog_manager',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/db/stats/serveronly_stats',
'$BUILD_DIR/mongo/db/views/views_mongod',
- '$BUILD_DIR/mongo/s/sharding_legacy_api',
+ '$BUILD_DIR/mongo/util/icu',
'core',
'current_op_common',
- 'dcommands_fcv',
'fsync_locked',
'killcursors_common',
+ 'list_collections_filter',
'profile_common',
+ 'test_commands_enabled',
'write_commands_common',
],
+)
+
+# Commands that should only be present in mongod
+env.Library(
+ target="mongod",
+ source=[
+ "apply_ops_cmd.cpp",
+ "compact.cpp",
+ "cpuload.cpp",
+ "do_txn_cmd.cpp",
+ "eval.cpp",
+ "group_cmd.cpp",
+ "haystack.cpp",
+ "kill_op.cpp",
+ "mr.cpp",
+ "oplog_application_checks.cpp",
+ "oplog_note.cpp",
+ "parallel_collection_scan.cpp",
+ "resize_oplog.cpp",
+ "restart_catalog_command.cpp",
+ "set_feature_compatibility_version_command.cpp",
+ "snapshot_management.cpp",
+ "test_commands.cpp",
+ "top_command.cpp",
+ "touch.cpp",
+ "txn_cmds.cpp",
+ "user_management_commands.cpp",
+ ],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/ops/write_ops_exec',
- '$BUILD_DIR/mongo/util/icu',
+ '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/client/clientdriver',
+ '$BUILD_DIR/mongo/db/auth/authmongod',
+ '$BUILD_DIR/mongo/db/background',
+ '$BUILD_DIR/mongo/db/catalog/catalog_helpers',
+ '$BUILD_DIR/mongo/db/catalog/catalog_impl',
+ '$BUILD_DIR/mongo/db/catalog/index_key_validate',
+ '$BUILD_DIR/mongo/db/commands',
+ '$BUILD_DIR/mongo/db/index_d',
+ '$BUILD_DIR/mongo/db/repl/oplog',
+ '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
+ '$BUILD_DIR/mongo/db/rw_concern_d',
+ '$BUILD_DIR/mongo/db/s/sharding_catalog_manager',
+ '$BUILD_DIR/mongo/s/sharding_legacy_api',
+ 'mongod_fcv',
+ 'mongod_fsync',
+ 'standalone',
+ 'servers',
+ 'test_commands_enabled',
],
)
@@ -342,7 +357,7 @@ env.CppUnitTest(
"$BUILD_DIR/mongo/db/query/query_test_service_context",
"$BUILD_DIR/mongo/db/serveronly",
"$BUILD_DIR/mongo/db/service_context_d",
- "dcommands",
+ "standalone",
],
)
@@ -357,7 +372,8 @@ env.CppUnitTest(
"$BUILD_DIR/mongo/db/serveronly",
"$BUILD_DIR/mongo/db/service_context_d",
"$BUILD_DIR/mongo/db/service_context_d_test_fixture",
- "dcommands",
+ "mongod",
+ "servers",
],
)
@@ -371,7 +387,7 @@ env.CppUnitTest(
"$BUILD_DIR/mongo/db/query/query_test_service_context",
"$BUILD_DIR/mongo/db/serveronly",
"$BUILD_DIR/mongo/db/service_context_d",
- "dcommands",
+ "standalone",
],
)
diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp
index 4d454be45fe..3787189f1c5 100644
--- a/src/mongo/db/commands/authentication_commands.cpp
+++ b/src/mongo/db/commands/authentication_commands.cpp
@@ -47,6 +47,7 @@
#include "mongo/db/auth/security_key.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/operation_context.h"
#include "mongo/platform/random.h"
#include "mongo/stdx/memory.h"
diff --git a/src/mongo/db/commands/cpuload.cpp b/src/mongo/db/commands/cpuload.cpp
index f34804fa97e..e713fb4811c 100644
--- a/src/mongo/db/commands/cpuload.cpp
+++ b/src/mongo/db/commands/cpuload.cpp
@@ -32,6 +32,7 @@
#include "mongo/base/init.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
namespace mongo {
diff --git a/src/mongo/db/commands/dbcheck.cpp b/src/mongo/db/commands/dbcheck.cpp
index 73065a744dc..2a3401a149b 100644
--- a/src/mongo/db/commands/dbcheck.cpp
+++ b/src/mongo/db/commands/dbcheck.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/catalog/health_log.h"
#include "mongo/db/catalog/uuid_catalog.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/jsobj.h"
diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp
index 8476c2d53d3..8c1b40f55de 100644
--- a/src/mongo/db/commands/fail_point_cmd.cpp
+++ b/src/mongo/db/commands/fail_point_cmd.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/privilege.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/util/fail_point_service.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/db/commands/generic.cpp b/src/mongo/db/commands/generic.cpp
index 3c1d64a5c2f..500a0755e42 100644
--- a/src/mongo/db/commands/generic.cpp
+++ b/src/mongo/db/commands/generic.cpp
@@ -42,6 +42,7 @@
#include "mongo/db/background.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/shutdown.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/db.h"
#include "mongo/db/introspect.h"
#include "mongo/db/jsobj.h"
diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp
index 342852c45ad..0eb54cd3ec2 100644
--- a/src/mongo/db/commands/hashcmd.cpp
+++ b/src/mongo/db/commands/hashcmd.cpp
@@ -41,6 +41,7 @@
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/privilege.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/hasher.h"
#include "mongo/db/jsobj.h"
diff --git a/src/mongo/db/commands/reap_logical_session_cache_now.cpp b/src/mongo/db/commands/reap_logical_session_cache_now.cpp
index dafd446825d..adb9b15e897 100644
--- a/src/mongo/db/commands/reap_logical_session_cache_now.cpp
+++ b/src/mongo/db/commands/reap_logical_session_cache_now.cpp
@@ -31,6 +31,7 @@
#include "mongo/base/init.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/logical_session_cache.h"
#include "mongo/db/operation_context.h"
diff --git a/src/mongo/db/commands/refresh_logical_session_cache_now.cpp b/src/mongo/db/commands/refresh_logical_session_cache_now.cpp
index 68e88bcec4c..f00adb6afb0 100644
--- a/src/mongo/db/commands/refresh_logical_session_cache_now.cpp
+++ b/src/mongo/db/commands/refresh_logical_session_cache_now.cpp
@@ -31,6 +31,7 @@
#include "mongo/base/init.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/logical_session_cache.h"
#include "mongo/db/logical_session_id_helpers.h"
#include "mongo/db/operation_context.h"
diff --git a/src/mongo/db/commands/restart_catalog_command.cpp b/src/mongo/db/commands/restart_catalog_command.cpp
index 46cd2cd9713..a3aefcd3168 100644
--- a/src/mongo/db/commands/restart_catalog_command.cpp
+++ b/src/mongo/db/commands/restart_catalog_command.cpp
@@ -37,6 +37,7 @@
#include "mongo/db/catalog/database.h"
#include "mongo/db/catalog/database_holder.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/db/commands/snapshot_management.cpp b/src/mongo/db/commands/snapshot_management.cpp
index 034d77db67b..565d01412a0 100644
--- a/src/mongo/db/commands/snapshot_management.cpp
+++ b/src/mongo/db/commands/snapshot_management.cpp
@@ -33,6 +33,7 @@
#include "mongo/base/init.h"
#include "mongo/bson/timestamp.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/repl/replication_coordinator.h"
diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp
index 51f1a72db62..153fb7d775f 100644
--- a/src/mongo/db/commands/test_commands.cpp
+++ b/src/mongo/db/commands/test_commands.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/catalog/collection.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/index_builder.h"
#include "mongo/db/op_observer.h"
diff --git a/src/mongo/db/commands/txn_cmds.cpp b/src/mongo/db/commands/txn_cmds.cpp
index 2397ec26bce..d3fefaa8e68 100644
--- a/src/mongo/db/commands/txn_cmds.cpp
+++ b/src/mongo/db/commands/txn_cmds.cpp
@@ -33,6 +33,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/op_observer.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
diff --git a/src/mongo/db/exec/SConscript b/src/mongo/db/exec/SConscript
index 55af8286f8a..c0c075d8cef 100644
--- a/src/mongo/db/exec/SConscript
+++ b/src/mongo/db/exec/SConscript
@@ -46,6 +46,9 @@ env.Library(
"$BUILD_DIR/mongo/db/index/index_access_methods",
"$BUILD_DIR/mongo/db/query_exec",
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
)
env.CppUnitTest(
diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp
index 39a79d3297c..c6056f5f3a4 100644
--- a/src/mongo/db/exec/stagedebug_cmd.cpp
+++ b/src/mongo/db/exec/stagedebug_cmd.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/catalog/index_catalog.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/exec/and_hash.h"
#include "mongo/db/exec/and_sorted.h"
diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript
index 5f25c2c6545..70bc9faa4eb 100644
--- a/src/mongo/db/pipeline/SConscript
+++ b/src/mongo/db/pipeline/SConscript
@@ -338,6 +338,9 @@ pipelineeEnv.Library(
'expression_context',
'granularity_rounder',
'parsed_aggregation_projection',
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
]
)
diff --git a/src/mongo/db/pipeline/document_source_list_local_cursors.cpp b/src/mongo/db/pipeline/document_source_list_local_cursors.cpp
index 0bafd966e71..7367eebe366 100644
--- a/src/mongo/db/pipeline/document_source_list_local_cursors.cpp
+++ b/src/mongo/db/pipeline/document_source_list_local_cursors.cpp
@@ -32,6 +32,7 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/auth/user_name.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/logical_session_id_helpers.h"
#include "mongo/db/pipeline/document_sources_gen.h"
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index 692c31bed7e..d4d7289d93a 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -135,7 +135,6 @@ env.Library(
'$BUILD_DIR/mongo/client/connection_pool',
'$BUILD_DIR/mongo/client/fetcher',
'$BUILD_DIR/mongo/db/auth/authorization_manager_global',
- '$BUILD_DIR/mongo/db/commands/server_status_core',
'$BUILD_DIR/mongo/db/concurrency/write_conflict_exception',
'$BUILD_DIR/mongo/db/server_parameters',
'$BUILD_DIR/mongo/db/service_context',
@@ -144,6 +143,9 @@ env.Library(
'$BUILD_DIR/mongo/executor/thread_pool_task_executor',
'$BUILD_DIR/mongo/util/concurrency/thread_pool',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
)
env.Library(
@@ -618,8 +620,6 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authorization_manager_global',
- '$BUILD_DIR/mongo/db/commands/dcommands_fsync',
- '$BUILD_DIR/mongo/db/commands/server_status_core',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/concurrency/write_conflict_exception',
'$BUILD_DIR/mongo/db/curop',
@@ -637,6 +637,9 @@ env.Library(
'repl_coordinator_interface',
'storage_interface',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/mongod_fsync',
+ ],
)
env.Library(
@@ -672,6 +675,7 @@ env.CppUnitTest(
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/dbdirectclient',
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
'idempotency_test_fixture',
'oplog_interface_local',
'sync_tail_test_fixture',
@@ -783,7 +787,6 @@ env.Library(
'vote_requester.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/index/index_descriptor',
@@ -806,6 +809,9 @@ env.Library(
'scatter_gather',
'topology_coordinator',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
)
env.Library(
@@ -1049,6 +1055,7 @@ env.Library(
LIBDEPS=[
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/commands',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/dbhelpers',
'$BUILD_DIR/mongo/db/lasterror',
@@ -1084,12 +1091,14 @@ env.Library(
'abstract_async_component',
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/client/fetcher',
- '$BUILD_DIR/mongo/db/commands/server_status_core',
'$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',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status_core',
+ ],
)
env.CppUnitTest(
@@ -1113,11 +1122,13 @@ env.Library(
'repl_coordinator_interface',
'replica_set_messages',
'$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/commands/server_status_core',
'$BUILD_DIR/mongo/db/namespace_string',
'$BUILD_DIR/mongo/db/stats/counters',
'$BUILD_DIR/mongo/db/stats/timer_stats',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status_core',
+ ],
)
env.CppUnitTest(
@@ -1250,9 +1261,11 @@ env.Library(
],
LIBDEPS=[
'collection_cloner',
- '$BUILD_DIR/mongo/db/commands/list_collections_filter',
'$BUILD_DIR/mongo/executor/task_executor_interface',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/list_collections_filter',
+ ],
)
env.CppUnitTest(
@@ -1262,6 +1275,7 @@ env.CppUnitTest(
'database_cloner',
'base_cloner_test_fixture',
'$BUILD_DIR/mongo/db/auth/authorization_manager_mock_init',
+ '$BUILD_DIR/mongo/db/commands/list_collections_filter',
'$BUILD_DIR/mongo/db/service_context_noop_init',
'$BUILD_DIR/mongo/unittest/task_executor_proxy',
],
@@ -1432,6 +1446,7 @@ env.Library(
'initial_syncer.cpp',
],
LIBDEPS=[
+ '$BUILD_DIR/mongo/client/fetcher',
'collection_cloner',
'database_cloner',
'databases_cloner',
@@ -1442,9 +1457,10 @@ env.Library(
'optime',
'rollback_checker',
'storage_interface',
- '$BUILD_DIR/mongo/client/fetcher',
- '$BUILD_DIR/mongo/db/commands/feature_compatibility_version_parser',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/feature_compatibility_version_parser',
+ ]
)
env.CppUnitTest(
@@ -1453,18 +1469,19 @@ env.CppUnitTest(
'initial_syncer_test.cpp',
],
LIBDEPS=[
+ '$BUILD_DIR/mongo/db/auth/authorization_manager_mock_init',
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
+ '$BUILD_DIR/mongo/db/query/command_request_response',
+ '$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture',
+ '$BUILD_DIR/mongo/unittest/concurrency',
'base_cloner_test_fixture',
- 'initial_syncer',
'data_replicator_external_state_mock',
+ 'initial_syncer',
'replication_process',
'replmocks',
'service_context_repl_mock_init',
'sync_source_selector_mock',
'task_executor_mock',
- '$BUILD_DIR/mongo/db/query/command_request_response',
- '$BUILD_DIR/mongo/db/auth/authorization_manager_mock_init',
- '$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture',
- '$BUILD_DIR/mongo/unittest/concurrency',
],
)
@@ -1528,6 +1545,9 @@ env.Library(
'repl_coordinator_interface',
'replica_set_messages',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
+ ],
)
env.Library(
@@ -1543,9 +1563,6 @@ env.Library(
'$BUILD_DIR/mongo/db/auth/authcore',
'$BUILD_DIR/mongo/db/catalog/catalog_helpers',
'$BUILD_DIR/mongo/db/cloner',
- '$BUILD_DIR/mongo/db/commands/dcommands_fcv',
- '$BUILD_DIR/mongo/db/commands/list_collections_filter',
- '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/index_d',
@@ -1576,6 +1593,10 @@ env.Library(
'reporter',
'rollback_source_impl',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
)
env.Library(
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 50245d57268..87f2f56e1a5 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -39,6 +39,7 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/client.h"
#include "mongo/db/commands/server_status_metric.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/repl/data_replicator_external_state_impl.h"
diff --git a/src/mongo/db/repl/noop_writer.cpp b/src/mongo/db/repl/noop_writer.cpp
index 9a6bfa89a0b..7496baf3179 100644
--- a/src/mongo/db/repl/noop_writer.cpp
+++ b/src/mongo/db/repl/noop_writer.cpp
@@ -31,6 +31,7 @@
#include "mongo/platform/basic.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/curop.h"
diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp
index 0aa7a7cc601..8b6cc7dd2e2 100644
--- a/src/mongo/db/repl/repl_set_commands.cpp
+++ b/src/mongo/db/repl/repl_set_commands.cpp
@@ -45,6 +45,7 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/server_status_metric.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/lasterror.h"
#include "mongo/db/op_observer.h"
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index a595d09cda5..761747a6135 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -39,6 +39,7 @@
#include "mongo/client/fetcher.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/logical_clock.h"
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript
index 8731a938055..14f267a5f65 100644
--- a/src/mongo/db/s/SConscript
+++ b/src/mongo/db/s/SConscript
@@ -109,8 +109,6 @@ env.Library(
'$BUILD_DIR/mongo/db/catalog/index_catalog',
'$BUILD_DIR/mongo/db/catalog/index_create',
'$BUILD_DIR/mongo/db/catalog_raii',
- '$BUILD_DIR/mongo/db/commands/dcommands_fcv',
- '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/s/client/shard_local',
'$BUILD_DIR/mongo/s/coreshard',
@@ -181,15 +179,19 @@ env.Library(
LIBDEPS=[
'$BUILD_DIR/mongo/db/catalog/collection_options',
'$BUILD_DIR/mongo/db/catalog_raii',
- '$BUILD_DIR/mongo/db/commands/dcommands_fcv',
'$BUILD_DIR/mongo/db/repl/read_concern_args',
'$BUILD_DIR/mongo/executor/network_interface',
'$BUILD_DIR/mongo/s/catalog/sharding_catalog_client',
'$BUILD_DIR/mongo/s/client/sharding_client',
'$BUILD_DIR/mongo/s/coreshard',
+ '$BUILD_DIR/mongo/s/sharding_legacy_api',
'balancer',
'type_shard_identity',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
+ '$BUILD_DIR/mongo/db/commands/servers',
+ ],
)
env.Library(
@@ -230,12 +232,14 @@ env.Library(
'split_vector_command.cpp',
'unset_sharding_command.cpp',
],
- LIBDEPS=[
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/bson/dotted_path_support',
- '$BUILD_DIR/mongo/db/commands/dcommands_fcv',
+ '$BUILD_DIR/mongo/db/commands/mongod_fcv',
'$BUILD_DIR/mongo/db/commands/server_status',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/index_d',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
+ '$BUILD_DIR/mongo/db/repl/replica_set_messages',
'$BUILD_DIR/mongo/s/commands/shared_cluster_commands',
'balancer',
'sharding_runtime_d',
diff --git a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp
index a6e50420b6b..f82925c61e4 100644
--- a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp
+++ b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/auth/privilege.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/hasher.h"
#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/namespace_string.h"
diff --git a/src/mongo/db/stats/SConscript b/src/mongo/db/stats/SConscript
index 146eced8c62..e8bce249241 100644
--- a/src/mongo/db/stats/SConscript
+++ b/src/mongo/db/stats/SConscript
@@ -97,10 +97,12 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/index/index_access_method',
'fill_locker_info',
'top',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
+ ],
)
diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript
index 2e8492bf1a8..1c435160278 100644
--- a/src/mongo/db/storage/SConscript
+++ b/src/mongo/db/storage/SConscript
@@ -182,9 +182,11 @@ env.Library(
"storage_init.cpp",
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands/server_status',
"storage_options",
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
+ ]
)
env.Library(
diff --git a/src/mongo/db/storage/mmap_v1/SConscript b/src/mongo/db/storage/mmap_v1/SConscript
index eaa8da9a00b..748fadad43e 100644
--- a/src/mongo/db/storage/mmap_v1/SConscript
+++ b/src/mongo/db/storage/mmap_v1/SConscript
@@ -23,34 +23,35 @@ env.Library(
)
env.Library(
- target = 'storage_mmapv1',
- source = [ "aligned_builder.cpp",
- "catalog/hashtab.cpp",
- "catalog/index_details.cpp",
- "catalog/namespace_details.cpp",
- "catalog/namespace_details_collection_entry.cpp",
- "catalog/namespace_details_rsv1_metadata.cpp",
- "catalog/namespace_index.cpp",
- "commit_notifier.cpp",
- "data_file.cpp",
- "data_file_sync.cpp",
- "durable_mapped_file.cpp",
- "dur.cpp",
- "durop.cpp",
- "dur_preplogbuffer.cpp",
- "dur_commitjob.cpp",
- "dur_recover.cpp",
- "dur_journal.cpp",
- "dur_journal_writer.cpp",
- "dur_recovery_unit.cpp",
- "journal_latency_test_cmd.cpp",
- "mmap_v1_database_catalog_entry.cpp",
- "mmap_v1_engine.cpp",
- "mmap_v1_extent_manager.cpp",
- "mmap_v1_init.cpp" if mmapv1 else "mmap_v1_noinit.cpp",
- "repair_database.cpp",
- ],
- LIBDEPS = [
+ target='storage_mmapv1',
+ source=[
+ "aligned_builder.cpp",
+ "catalog/hashtab.cpp",
+ "catalog/index_details.cpp",
+ "catalog/namespace_details.cpp",
+ "catalog/namespace_details_collection_entry.cpp",
+ "catalog/namespace_details_rsv1_metadata.cpp",
+ "catalog/namespace_index.cpp",
+ "commit_notifier.cpp",
+ "data_file.cpp",
+ "data_file_sync.cpp",
+ "durable_mapped_file.cpp",
+ "dur.cpp",
+ "durop.cpp",
+ "dur_preplogbuffer.cpp",
+ "dur_commitjob.cpp",
+ "dur_recover.cpp",
+ "dur_journal.cpp",
+ "dur_journal_writer.cpp",
+ "dur_recovery_unit.cpp",
+ "journal_latency_test_cmd.cpp",
+ "mmap_v1_database_catalog_entry.cpp",
+ "mmap_v1_engine.cpp",
+ "mmap_v1_extent_manager.cpp",
+ "mmap_v1_init.cpp" if mmapv1 else "mmap_v1_noinit.cpp",
+ "repair_database.cpp",
+ ],
+ LIBDEPS=[
'record_store_v1',
'record_access_tracker',
'repair_database_interface',
@@ -66,7 +67,6 @@ env.Library(
'$BUILD_DIR/mongo/db/catalog/index_catalog',
'$BUILD_DIR/mongo/db/catalog/index_create',
'$BUILD_DIR/mongo/db/commands',
- '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/index_names',
'$BUILD_DIR/mongo/db/index/index_descriptor',
@@ -77,6 +77,10 @@ env.Library(
'$BUILD_DIR/mongo/db/index/index_access_methods',
'$BUILD_DIR/mongo/db/write_ops',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
)
env.Library(
@@ -163,7 +167,6 @@ env.Library(
'touch_pages.cpp',
],
LIBDEPS= [
- '$BUILD_DIR/mongo/db/commands/server_status_core',
'$BUILD_DIR/mongo/db/curop',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/storage/storage_options',
diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
index b31bd4945db..318fea0d755 100644
--- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
+++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
@@ -39,6 +39,7 @@
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/privilege.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/curop.h"
#include "mongo/db/index/index_access_method.h"
#include "mongo/db/index/index_descriptor.h"
diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript
index b6781fede41..5f824dc1d21 100644
--- a/src/mongo/db/storage/wiredtiger/SConscript
+++ b/src/mongo/db/storage/wiredtiger/SConscript
@@ -96,9 +96,9 @@ if wiredtiger:
'$BUILD_DIR/mongo/db/storage/kv/kv_engine',
'$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
'$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
- '$BUILD_DIR/mongo/db/commands/server_status',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
],
)
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index e885d71aa15..23c7a555cf9 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -38,6 +38,7 @@
#include "mongo/base/checked_cast.h"
#include "mongo/base/static_assert.h"
#include "mongo/bson/util/builder.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/locker.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/global_settings.h"
diff --git a/src/mongo/dbtests/SConscript b/src/mongo/dbtests/SConscript
index ca58e8a4c4b..58a841ba1dd 100644
--- a/src/mongo/dbtests/SConscript
+++ b/src/mongo/dbtests/SConscript
@@ -119,6 +119,8 @@ dbtest = env.Program(
"$BUILD_DIR/mongo/bson/mutable/mutable_bson_test_utils",
"$BUILD_DIR/mongo/db/auth/authmocks",
"$BUILD_DIR/mongo/db/bson/dotted_path_support",
+ "$BUILD_DIR/mongo/db/commands/mongod",
+ "$BUILD_DIR/mongo/db/commands/test_commands_enabled",
"$BUILD_DIR/mongo/db/concurrency/deferred_writer",
"$BUILD_DIR/mongo/db/logical_clock",
"$BUILD_DIR/mongo/db/logical_time_metadata_hook",
diff --git a/src/mongo/dbtests/dbtests.cpp b/src/mongo/dbtests/dbtests.cpp
index 538ff213702..5e51f5c5c0b 100644
--- a/src/mongo/dbtests/dbtests.cpp
+++ b/src/mongo/dbtests/dbtests.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/auth/authorization_manager_global.h"
#include "mongo/db/catalog/index_create.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/logical_clock.h"
diff --git a/src/mongo/executor/SConscript b/src/mongo/executor/SConscript
index 1dcd7a94e03..a31aede6c85 100644
--- a/src/mongo/executor/SConscript
+++ b/src/mongo/executor/SConscript
@@ -171,7 +171,6 @@ env.Library(
'$BUILD_DIR/mongo/base/system_error',
'$BUILD_DIR/mongo/client/client_query',
'$BUILD_DIR/mongo/db/auth/authcommon',
- '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/wire_version',
'$BUILD_DIR/mongo/rpc/command_status',
'$BUILD_DIR/mongo/rpc/rpc',
@@ -183,7 +182,11 @@ env.Library(
'egress_tag_closer_manager',
'network_interface',
'task_executor_interface',
- ])
+ ],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
+ ],
+)
env.Library(
target='async_stream',
diff --git a/src/mongo/executor/network_interface_asio_auth.cpp b/src/mongo/executor/network_interface_asio_auth.cpp
index 8995495df3d..b9eefb60646 100644
--- a/src/mongo/executor/network_interface_asio_auth.cpp
+++ b/src/mongo/executor/network_interface_asio_auth.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/auth/authorization_manager_global.h"
#include "mongo/db/auth/internal_user_auth.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/server_options.h"
#include "mongo/db/wire_version.h"
#include "mongo/rpc/factory.h"
diff --git a/src/mongo/s/commands/SConscript b/src/mongo/s/commands/SConscript
index 3501319d43b..edc5d655db5 100644
--- a/src/mongo/s/commands/SConscript
+++ b/src/mongo/s/commands/SConscript
@@ -12,9 +12,6 @@ env.Library(
'cluster_get_shard_map_cmd.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands',
- '$BUILD_DIR/mongo/db/commands/killcursors_common',
- '$BUILD_DIR/mongo/db/commands/current_op_common',
'$BUILD_DIR/mongo/s/async_requests_sender',
]
)
@@ -93,10 +90,15 @@ env.Library(
'strategy.cpp',
env.Idlc('cluster_multicast.idl')[0],
],
- LIBDEPS=[
+ LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/auth/authmongos',
+ '$BUILD_DIR/mongo/db/commands/core',
+ '$BUILD_DIR/mongo/db/commands/current_op_common',
+ '$BUILD_DIR/mongo/db/commands/servers',
+ '$BUILD_DIR/mongo/db/commands/feature_compatibility_version_parser',
'$BUILD_DIR/mongo/db/commands/killcursors_common',
'$BUILD_DIR/mongo/db/commands/profile_common',
+ '$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/commands/write_commands_common',
'$BUILD_DIR/mongo/db/ftdc/ftdc_server',
'$BUILD_DIR/mongo/db/logical_session_cache_impl',
diff --git a/src/mongo/s/commands/cluster_multicast.cpp b/src/mongo/s/commands/cluster_multicast.cpp
index f2f1de366f8..105893fb7d4 100644
--- a/src/mongo/s/commands/cluster_multicast.cpp
+++ b/src/mongo/s/commands/cluster_multicast.cpp
@@ -32,6 +32,7 @@
#include "mongo/base/init.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/executor/async_multicaster.h"
#include "mongo/executor/task_executor_pool.h"
#include "mongo/s/catalog/sharding_catalog_client.h"
diff --git a/src/mongo/s/commands/cluster_restart_catalog_command.cpp b/src/mongo/s/commands/cluster_restart_catalog_command.cpp
index 91a08031056..b91259a8de6 100644
--- a/src/mongo/s/commands/cluster_restart_catalog_command.cpp
+++ b/src/mongo/s/commands/cluster_restart_catalog_command.cpp
@@ -29,6 +29,7 @@
#include "mongo/platform/basic.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/s/commands/cluster_commands_helpers.h"
namespace mongo {
diff --git a/src/mongo/s/write_ops/SConscript b/src/mongo/s/write_ops/SConscript
index 0bfc32d72c6..62157927897 100644
--- a/src/mongo/s/write_ops/SConscript
+++ b/src/mongo/s/write_ops/SConscript
@@ -32,9 +32,11 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/s/async_requests_sender',
- '$BUILD_DIR/mongo/s/commands/shared_cluster_commands',
'batch_write_types',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/s/commands/shared_cluster_commands',
+ ]
)
env.Library(
diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
index f3ccb536a6c..594e415d2c1 100644
--- a/src/mongo/util/SConscript
+++ b/src/mongo/util/SConscript
@@ -343,10 +343,12 @@ if env['MONGO_ALLOCATOR'] == 'tcmalloc':
'heap_profiler.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/server_parameters',
'$BUILD_DIR/mongo/transport/service_executor',
],
+ LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/commands/server_status',
+ ],
LIBDEPS_DEPENDENTS=[
'$BUILD_DIR/mongo/mongodmain',
],