From 27e0275301eed05bea3d65c766dbe76ee1da9b8a Mon Sep 17 00:00:00 2001 From: Henrik Edin Date: Fri, 18 May 2018 17:29:14 -0400 Subject: SERVER-32198 Get rid of CollectionShardingState::collectionIsSharded (cherry picked from commit 80de0da37b00dbeed576b28a842cb172b6714358) SERVER-35773 Remove references to the CatalogCache from MetadataManager (cherry picked from commit 2aa65a86193e5d38934a4f2d6b0a8298e2432485) SERVER-32198 Add support for an optional `vWanted` to StaleConfigInfo (cherry picked from commit 60559a00b81293184922b3418a8e56610edf8dd9) SERVER-36054 Remove ScopedCollectionMetadata's operator bool (cherry picked from commit c9c340ad6e9e1f33cb001a8375c62d6b16138c74) SERVER-36054 Remove more unused methods from CSS/MetadataManager (cherry picked from commit ca04f5bcf9bfa73c9162b3a77225c997c6deec8a) SERVER-36116 Get rid of CollectionShardingState::resetAll (cherry picked from commit db1cc80d13d203b6351f5510f7756cc1c7bfc0ea) SERVER-36054 Get rid of unused methods from CollectionShardingState (cherry picked from commit 884d232473dca72e0872f0e540d4c3108c1e0b3d) SERVER-36164 Decouple ScopedCollectionMetadata from MetadataManager (cherry picked from commit d91262c4a2ed7d94923c3b1c5ff5d208aa981c73) SERVER-29908 Move CollectionShardingState under sharding_api_d (cherry picked from commit e491e284e8066929c8272c96a3128241ab481be8) SERVER-29908 Remove ShardingState::appendInfo Expose the ShardingState properties and move the appendInfo logic to be entirely inside the 'getShardingState' function, which is its only consumer. (cherry picked from commit 24e411d5cd7f64c5b4da25a351529cd1873284b8) SERVER-29908 Move 'updateConfigServerOpTimeFromMetadata' out of ShardingState (cherry picked from commit 7a97557ce5bf74dc2b663762b7a5ffb9c958d580) SERVER-29908 Move all runtime logic out of ShardingState ... and move it into a ShardingInitializationMongoD class, which is responsible for driving the sharding-awareness of the node and setting it onto ShardingState. Also gets rid of the 'sharding' library, so there is no more library dependency cycle. (cherry picked from commit 200c3dc58410d8b3287a2075cc9b2ad085100e83) SERVER-29908 Fold the 'sharding_connection_hook' library into 'sharding_initialization' ... and also remove dependency of MongoS on the replication coordinator (cherry picked from commit fab6864f4edcae7bb304f79e601f1f62cc376a77) --- src/mongo/db/s/SConscript | 100 +++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 67 deletions(-) (limited to 'src/mongo/db/s/SConscript') diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript index b3e68cd3e20..c92e1502a8e 100644 --- a/src/mongo/db/s/SConscript +++ b/src/mongo/db/s/SConscript @@ -12,13 +12,16 @@ env.Library( target='sharding_api_d', source=[ 'collection_metadata.cpp', + 'collection_sharding_state.cpp', 'database_sharding_state.cpp', 'operation_sharding_state.cpp', 'sharded_connection_info.cpp', 'sharding_migration_critical_section.cpp', + 'sharding_state.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', + '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/range_arithmetic', '$BUILD_DIR/mongo/s/sharding_routing_table', ], @@ -31,10 +34,14 @@ env.Library( 'active_move_primaries_registry.cpp', 'chunk_move_write_concern_options.cpp', 'chunk_splitter.cpp', + 'collection_range_deleter.cpp', + 'collection_sharding_runtime.cpp', + 'collection_sharding_state_factory_shard.cpp', 'config_server_op_observer.cpp', 'implicit_create_collection.cpp', - 'migration_chunk_cloner_source.cpp', + 'metadata_manager.cpp', 'migration_chunk_cloner_source_legacy.cpp', + 'migration_chunk_cloner_source.cpp', 'migration_destination_manager.cpp', 'migration_source_manager.cpp', 'migration_util.cpp', @@ -50,12 +57,15 @@ env.Library( 'shard_metadata_util.cpp', 'shard_server_catalog_cache_loader.cpp', 'shard_server_op_observer.cpp', + 'sharding_config_optime_gossip.cpp', + 'sharding_initialization_mongod.cpp', 'sharding_state_recovery.cpp', 'sharding_statistics.cpp', 'split_chunk.cpp', 'split_vector.cpp', ], LIBDEPS=[ + '$BUILD_DIR/mongo/db/catalog/index_create', '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/dbhelpers', @@ -63,12 +73,24 @@ env.Library( '$BUILD_DIR/mongo/db/repl/oplog', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/rw_concern_d', - 'sharding', + '$BUILD_DIR/mongo/s/client/shard_local', + '$BUILD_DIR/mongo/s/sharding_initialization', + 'migration_types', 'sharding_api_d', 'sharding_catalog_manager', ], ) +env.Library( + target='sharding_runtime_d_embedded', + source=[ + 'collection_sharding_state_factory_embedded.cpp', + ], + LIBDEPS=[ + 'sharding_api_d', + ], +) + env.CppUnitTest( target='config_server_op_observer_test', source=[ @@ -97,6 +119,7 @@ env.Library( env.Library( target='type_shard_identity', source=[ + env.Idlc('add_shard_cmd.idl')[0], 'type_shard_identity.cpp', ], LIBDEPS=[ @@ -107,41 +130,6 @@ env.Library( ], ) -env.Library( - target='sharding', - source=[ - 'collection_range_deleter.cpp', - 'collection_sharding_state.cpp', - 'metadata_manager.cpp', - 'sharding_egress_metadata_hook_for_mongod.cpp', - 'sharding_initialization_mongod.cpp', - 'sharding_state.cpp', - ], - LIBDEPS=[ - '$BUILD_DIR/mongo/base', - '$BUILD_DIR/mongo/bson/util/bson_extract', - '$BUILD_DIR/mongo/db/bson/dotted_path_support', - '$BUILD_DIR/mongo/db/catalog/index_catalog', - '$BUILD_DIR/mongo/db/catalog/index_create', - '$BUILD_DIR/mongo/db/catalog_raii', - '$BUILD_DIR/mongo/db/common', - '$BUILD_DIR/mongo/s/client/shard_local', - '$BUILD_DIR/mongo/s/coreshard', - '$BUILD_DIR/mongo/s/is_mongos', - '$BUILD_DIR/mongo/s/sharding_initialization', - '$BUILD_DIR/mongo/s/sharding_task_executor', - '$BUILD_DIR/mongo/util/elapsed_tracker', - 'balancer', - 'migration_types', - 'sharding_api_d', - 'type_shard_identity', - ], - LIBDEPS_TAGS=[ - # TODO(ADAM, 2017-01-06): See `CYCLE` tags above - 'illegal_cyclic_or_unresolved_dependencies_whitelisted', - ], -) - env.Library( target='balancer', source=[ @@ -266,6 +254,7 @@ env.Library( '$BUILD_DIR/mongo/db/repl/replica_set_messages', '$BUILD_DIR/mongo/s/commands/cluster_commands_helpers', '$BUILD_DIR/mongo/s/commands/shared_cluster_commands', + '$BUILD_DIR/mongo/s/sharding_initialization', 'balancer', 'sharding_runtime_d', ], @@ -293,7 +282,7 @@ env.CppUnitTest( ) env.CppUnitTest( - target='shard_test', + target='shard_server_test', source=[ 'active_migrations_registry_test.cpp', 'active_move_primaries_registry_test.cpp', @@ -302,14 +291,16 @@ env.CppUnitTest( 'migration_chunk_cloner_source_legacy_test.cpp', 'migration_destination_manager_test.cpp', 'namespace_metadata_change_notifications_test.cpp', - 'sharding_state_test.cpp', + 'shard_metadata_util_test.cpp', 'shard_server_catalog_cache_loader_test.cpp', + 'sharding_initialization_mongod_test.cpp', + 'sharding_initialization_op_observer_test.cpp', + 'split_vector_test.cpp', ], LIBDEPS=[ 'sharding_runtime_d', '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/query/query_request', - '$BUILD_DIR/mongo/db/service_context_d_test_fixture', '$BUILD_DIR/mongo/s/catalog/dist_lock_manager_mock', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_mock', @@ -318,8 +309,9 @@ env.CppUnitTest( ) env.CppUnitTest( - target='collection_sharding_state_test', + target='collection_sharding_runtime_test', source=[ + 'collection_metadata_filtering_test.cpp', 'collection_metadata_test.cpp', 'collection_range_deleter_test.cpp', 'collection_sharding_state_test.cpp', @@ -336,31 +328,6 @@ env.CppUnitTest( ], ) -env.CppUnitTest( - target='shard_metadata_util_test', - source=[ - 'shard_metadata_util_test.cpp', - ], - LIBDEPS=[ - '$BUILD_DIR/mongo/db/auth/authmocks', - '$BUILD_DIR/mongo/s/shard_server_test_fixture', - 'sharding', - ], -) - -env.CppUnitTest( - target='split_vector_test', - source=[ - 'split_vector_test.cpp', - ], - LIBDEPS=[ - '$BUILD_DIR/mongo/db/auth/authmocks', - '$BUILD_DIR/mongo/db/dbdirectclient', - '$BUILD_DIR/mongo/s/shard_server_test_fixture', - 'sharding', - ] -) - env.CppUnitTest( target='session_catalog_migration_source_test', source=[ @@ -369,7 +336,6 @@ env.CppUnitTest( LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/repl/mock_repl_coord_server_fixture', - 'sharding', ] ) -- cgit v1.2.1