diff options
author | Joanna Huang <joannahuang@Joannas-MacBook-Pro.local> | 2017-08-01 13:46:41 -0400 |
---|---|---|
committer | Joanna Huang <joannahuang@Joannas-MacBook-Pro.local> | 2017-08-09 10:02:15 -0400 |
commit | 373e543253801f53dfc881f46f6346c96f43e70d (patch) | |
tree | e7040d4a7ffd7b346b5b2eba1befdb7a1b4d70e2 /src/mongo/db | |
parent | 041f96f0d1b8a153f76bd86b3d394961fa09b716 (diff) | |
download | mongo-373e543253801f53dfc881f46f6346c96f43e70d.tar.gz |
SERVER-30443 Create PeriodicBalancerSettingsRefresher on the ServiceContext
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/s/sharding_state.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index 5bdfcc46ca2..93dd61ad3ef 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -87,6 +87,7 @@ #include "mongo/s/client/shard_registry.h" #include "mongo/s/cluster_identity_loader.h" #include "mongo/s/grid.h" +#include "mongo/s/periodic_balancer_settings_refresher.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/memory.h" #include "mongo/stdx/thread.h" @@ -714,6 +715,7 @@ void ReplicationCoordinatorExternalStateImpl::shardingOnStepDownHook() { invariant(serverGlobalParams.clusterRole == ClusterRole::ShardServer); ShardingState::get(_service)->interruptChunkSplitter(); CatalogCacheLoader::get(_service).onStepDown(); + PeriodicBalancerSettingsRefresher::get(_service)->stop(); } ShardingState::get(_service)->markCollectionsNotShardedAtStepdown(); @@ -802,6 +804,7 @@ void ReplicationCoordinatorExternalStateImpl::_shardingOnTransitionToPrimaryHook } CatalogCacheLoader::get(_service).onStepUp(); + PeriodicBalancerSettingsRefresher::get(_service)->start(); ShardingState::get(_service)->initiateChunkSplitter(); } diff --git a/src/mongo/db/s/sharding_state.cpp b/src/mongo/db/s/sharding_state.cpp index 5c0f925cb91..b775ca6ae0b 100644 --- a/src/mongo/db/s/sharding_state.cpp +++ b/src/mongo/db/s/sharding_state.cpp @@ -343,7 +343,6 @@ Status ShardingState::initializeFromShardIdentity(OperationContext* opCtx, repl::MemberState::RS_PRIMARY); CatalogCacheLoader::get(opCtx).initializeReplicaSetRole(isStandaloneOrPrimary); - _chunkSplitter->setReplicaSetMode(isStandaloneOrPrimary); log() << "initialized sharding components for " |