diff options
author | Randolph Tan <randolph@mongodb.com> | 2019-09-13 18:46:46 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-13 18:46:46 +0000 |
commit | c4467548514ff07721f4de215b3b74d1111ee9d1 (patch) | |
tree | 8441af03d79e894ff41e1f93b265c0eb7fd661fe /src/mongo/db/s | |
parent | 707ee6aa025936c5566625cc1b23cf2ffc6de9dc (diff) | |
download | mongo-c4467548514ff07721f4de215b3b74d1111ee9d1.tar.gz |
SERVER-43174 Make migration destination threads killable
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r-- | src/mongo/db/s/migration_destination_manager.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/s/session_catalog_migration_destination.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp index 1b2bb193500..8cbb3b2875c 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -389,7 +389,8 @@ repl::OpTime MigrationDestinationManager::cloneDocumentsFromDonor( repl::OpTime lastOpApplied; stdx::thread inserterThread{[&] { - ThreadClient tc("chunkInserter", opCtx->getServiceContext()); + Client::initKillableThread("chunkInserter", opCtx->getServiceContext()); + auto inserterOpCtx = Client::getCurrent()->makeOperationContext(); auto consumerGuard = makeGuard([&] { batches.closeConsumerEnd(); @@ -716,10 +717,9 @@ void MigrationDestinationManager::cloneCollectionIndexesAndOptions(OperationCont } void MigrationDestinationManager::_migrateThread() { - Client::initThread("migrateThread"); + Client::initKillableThread("migrateThread", getGlobalServiceContext()); auto opCtx = Client::getCurrent()->makeOperationContext(); - if (AuthorizationManager::get(opCtx->getServiceContext())->isAuthEnabled()) { AuthorizationSession::get(opCtx->getClient())->grantInternalAuthorization(opCtx.get()); } diff --git a/src/mongo/db/s/session_catalog_migration_destination.cpp b/src/mongo/db/s/session_catalog_migration_destination.cpp index ea24c80f7e3..ae7ca172c5f 100644 --- a/src/mongo/db/s/session_catalog_migration_destination.cpp +++ b/src/mongo/db/s/session_catalog_migration_destination.cpp @@ -366,8 +366,8 @@ void SessionCatalogMigrationDestination::join() { * 6. Wait for writes to be committed to majority of the replica set. */ void SessionCatalogMigrationDestination::_retrieveSessionStateFromSource(ServiceContext* service) { - Client::initThread( - "sessionCatalogMigrationProducer-" + _migrationSessionId.toString(), service, nullptr); + Client::initKillableThread("sessionCatalogMigrationProducer-" + _migrationSessionId.toString(), + service); bool oplogDrainedAfterCommiting = false; ProcessOplogResult lastResult; |