summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-08-14 13:03:03 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-08-15 12:57:32 -0400
commitfab6864f4edcae7bb304f79e601f1f62cc376a77 (patch)
treeab6dd5752b59d7af969ab193c24e47a3a36a4d07 /src/mongo/s
parentf61c4e4e9960a00d8da16c1053cd702972f90995 (diff)
downloadmongo-fab6864f4edcae7bb304f79e601f1f62cc376a77.tar.gz
SERVER-29908 Fold the 'sharding_connection_hook' library into 'sharding_initialization'
... and also remove dependency of MongoS on the replication coordinator
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/SConscript16
-rw-r--r--src/mongo/s/catalog/sharding_catalog_log_change_test.cpp2
-rw-r--r--src/mongo/s/catalog/sharding_catalog_test.cpp2
-rw-r--r--src/mongo/s/client/SConscript15
-rw-r--r--src/mongo/s/cluster_identity_loader_test.cpp1
-rw-r--r--src/mongo/s/sharding_initialization.cpp8
6 files changed, 11 insertions, 33 deletions
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index 096f0228a2b..2796119cc9e 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -69,26 +69,29 @@ env.Library(
],
)
-# Functionality for initializing global sharding state
+# Functionality for initializing all the services used by sharding, which are common between MongoS
+# and MongoD
env.Library(
target='sharding_initialization',
source=[
'sharding_initialization.cpp',
+ 'client/sharding_connection_hook.cpp',
+ 'client/sharding_network_connection_hook.cpp',
],
LIBDEPS=[
'$BUILD_DIR/mongo/db/logical_session_cache_factory_mongos',
- '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/s/catalog/dist_lock_catalog_impl',
'$BUILD_DIR/mongo/s/catalog/replset_dist_lock_manager',
'$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl',
'$BUILD_DIR/mongo/util/periodic_runner_factory',
- 'client/sharding_connection_hook',
- 'coreshard',
- 'sharding_task_executor',
+ 'sharding_legacy_api',
],
LIBDEPS_PRIVATE=[
+ '$BUILD_DIR/mongo/db/auth/internal_user_auth',
'$BUILD_DIR/mongo/executor/thread_pool_task_executor',
- ]
+ 'coreshard',
+ 'sharding_task_executor',
+ ],
)
env.Library(
@@ -468,7 +471,6 @@ env.CppUnitTest(
'$BUILD_DIR/mongo/db/service_context_test_fixture',
'$BUILD_DIR/mongo/dbtests/mocklib',
'$BUILD_DIR/mongo/util/net/network',
- 'client/sharding_connection_hook',
'sharding_legacy_api',
]
)
diff --git a/src/mongo/s/catalog/sharding_catalog_log_change_test.cpp b/src/mongo/s/catalog/sharding_catalog_log_change_test.cpp
index 0080340d341..9653888feb9 100644
--- a/src/mongo/s/catalog/sharding_catalog_log_change_test.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_log_change_test.cpp
@@ -36,7 +36,7 @@
#include "mongo/db/commands.h"
#include "mongo/executor/network_interface_mock.h"
#include "mongo/executor/task_executor.h"
-#include "mongo/s/catalog/sharding_catalog_client_impl.h"
+#include "mongo/s/catalog/sharding_catalog_client.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/sharding_router_test_fixture.h"
#include "mongo/stdx/chrono.h"
diff --git a/src/mongo/s/catalog/sharding_catalog_test.cpp b/src/mongo/s/catalog/sharding_catalog_test.cpp
index eb9b60067d0..79036d4f824 100644
--- a/src/mongo/s/catalog/sharding_catalog_test.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_test.cpp
@@ -44,7 +44,7 @@
#include "mongo/rpc/metadata/repl_set_metadata.h"
#include "mongo/rpc/metadata/tracking_metadata.h"
#include "mongo/s/catalog/dist_lock_manager_mock.h"
-#include "mongo/s/catalog/sharding_catalog_client_impl.h"
+#include "mongo/s/catalog/sharding_catalog_client.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/catalog/type_collection.h"
#include "mongo/s/catalog/type_database.h"
diff --git a/src/mongo/s/client/SConscript b/src/mongo/s/client/SConscript
index cd74bbc9923..5dbae27a390 100644
--- a/src/mongo/s/client/SConscript
+++ b/src/mongo/s/client/SConscript
@@ -31,21 +31,6 @@ env.CppUnitTest(
],
)
-env.Library(
- target='sharding_connection_hook',
- source=[
- 'sharding_connection_hook.cpp',
- 'sharding_network_connection_hook.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/s/coreshard',
- '$BUILD_DIR/mongo/s/sharding_legacy_api',
- ],
- LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/auth/internal_user_auth',
- ],
-)
-
env.CppUnitTest(
target='shard_registry_test',
source=[
diff --git a/src/mongo/s/cluster_identity_loader_test.cpp b/src/mongo/s/cluster_identity_loader_test.cpp
index 18685da1086..a10a9673cdd 100644
--- a/src/mongo/s/cluster_identity_loader_test.cpp
+++ b/src/mongo/s/cluster_identity_loader_test.cpp
@@ -41,7 +41,6 @@
#include "mongo/rpc/metadata/repl_set_metadata.h"
#include "mongo/rpc/metadata/tracking_metadata.h"
#include "mongo/s/catalog/config_server_version.h"
-#include "mongo/s/catalog/sharding_catalog_client_impl.h"
#include "mongo/s/catalog/type_config_version.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/cluster_identity_loader.h"
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp
index c090379b83b..af635690253 100644
--- a/src/mongo/s/sharding_initialization.cpp
+++ b/src/mongo/s/sharding_initialization.cpp
@@ -35,13 +35,11 @@
#include <string>
#include "mongo/base/status.h"
-#include "mongo/client/remote_command_targeter_factory_impl.h"
#include "mongo/db/audit.h"
#include "mongo/db/keys_collection_client_sharded.h"
#include "mongo/db/keys_collection_manager.h"
#include "mongo/db/logical_clock.h"
#include "mongo/db/logical_time_validator.h"
-#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/server_options.h"
#include "mongo/db/server_parameters.h"
#include "mongo/db/service_context.h"
@@ -255,12 +253,6 @@ Status initializeGlobalShardingState(OperationContext* opCtx,
LogicalTimeValidator::set(opCtx->getServiceContext(),
stdx::make_unique<LogicalTimeValidator>(keyManager));
- auto replCoord = repl::ReplicationCoordinator::get(opCtx->getClient()->getServiceContext());
- if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer &&
- replCoord->getMemberState().primary()) {
- LogicalTimeValidator::get(opCtx)->enableKeyGenerator(opCtx, true);
- }
-
return Status::OK();
}