summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_initialization.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-12-27 13:53:03 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-01-03 17:02:50 -0500
commit310b84d607506406c78925693b4bf71dd95e35e5 (patch)
tree749a9fad2d4e4b89e4d210d92d0c9d29792eb4df /src/mongo/s/sharding_initialization.cpp
parentf27c375287f7c69067d5ba437533622dbecf41c9 (diff)
downloadmongo-310b84d607506406c78925693b4bf71dd95e35e5.tar.gz
SERVER-38522 Make persistParticipantList/persistDecision/deleteCoordinatorDoc asynchronous
Also splits TransactionCoordinator util into driver and futures components
Diffstat (limited to 'src/mongo/s/sharding_initialization.cpp')
-rw-r--r--src/mongo/s/sharding_initialization.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp
index 493d160ba45..a63374f501d 100644
--- a/src/mongo/s/sharding_initialization.cpp
+++ b/src/mongo/s/sharding_initialization.cpp
@@ -228,15 +228,16 @@ Status initializeGlobalShardingState(OperationContext* opCtx,
std::move(network), hookBuilder, connPoolOptions, taskExecutorPoolSize);
executorPool->startup();
- auto const grid = Grid::get(opCtx);
- grid->init(
- makeCatalogClient(opCtx->getServiceContext(), distLockProcessId),
- std::move(catalogCache),
- stdx::make_unique<ShardRegistry>(std::move(shardFactory), configCS),
- stdx::make_unique<ClusterCursorManager>(getGlobalServiceContext()->getPreciseClockSource()),
- stdx::make_unique<BalancerConfiguration>(),
- std::move(executorPool),
- networkPtr);
+ const auto service = opCtx->getServiceContext();
+ auto const grid = Grid::get(service);
+
+ grid->init(makeCatalogClient(service, distLockProcessId),
+ std::move(catalogCache),
+ stdx::make_unique<ShardRegistry>(std::move(shardFactory), configCS),
+ stdx::make_unique<ClusterCursorManager>(service->getPreciseClockSource()),
+ stdx::make_unique<BalancerConfiguration>(),
+ std::move(executorPool),
+ networkPtr);
// The shard registry must be started once the grid is initialized
grid->shardRegistry()->startup(opCtx);
@@ -250,10 +251,9 @@ Status initializeGlobalShardingState(OperationContext* opCtx,
std::make_shared<KeysCollectionManager>(KeysCollectionManager::kKeyManagerPurposeString,
std::move(keysCollectionClient),
Seconds(KeysRotationIntervalSec));
- keyManager->startMonitoring(opCtx->getServiceContext());
+ keyManager->startMonitoring(service);
- LogicalTimeValidator::set(opCtx->getServiceContext(),
- stdx::make_unique<LogicalTimeValidator>(keyManager));
+ LogicalTimeValidator::set(service, stdx::make_unique<LogicalTimeValidator>(keyManager));
return Status::OK();
}