summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2021-10-25 04:15:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-01 18:46:14 +0000
commitc4686a8ae4ac666cc10d25484abe003ab21fb835 (patch)
tree1e4f00817f48ffe811cd61ef86a4e9626b7ce564
parent15c035e026c4b15ac4ab2df86b68d3d688bf4bd6 (diff)
downloadmongo-c4686a8ae4ac666cc10d25484abe003ab21fb835.tar.gz
SERVER-60782: ThreadPool::waitForIdle should not be called concurrently with shutdown in TenantOplogApplier shutdown
(cherry picked from commit 90a82a5938e5655e283518feb29c92bdb490bb9d)
-rw-r--r--src/mongo/db/repl/tenant_migration_recipient_service.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/repl/tenant_migration_recipient_service.cpp b/src/mongo/db/repl/tenant_migration_recipient_service.cpp
index c0b390b2dce..1529c05fa2a 100644
--- a/src/mongo/db/repl/tenant_migration_recipient_service.cpp
+++ b/src/mongo/db/repl/tenant_migration_recipient_service.cpp
@@ -1839,8 +1839,6 @@ void TenantMigrationRecipientService::Instance::_cleanupOnDataSyncCompletion(Sta
setPromiseErrorifNotReady(lk, _dataConsistentPromise, status);
setPromiseErrorifNotReady(lk, _dataSyncCompletionPromise, status);
- shutdownTarget(lk, _writerPool);
-
// Save them to join() with it outside of _mutex.
using std::swap;
swap(savedDonorOplogFetcher, _donorOplogFetcher);
@@ -1851,7 +1849,10 @@ void TenantMigrationRecipientService::Instance::_cleanupOnDataSyncCompletion(Sta
// Perform join outside the lock to avoid deadlocks.
joinTarget(savedDonorOplogFetcher);
joinTarget(savedTenantOplogApplier);
- joinTarget(savedWriterPool);
+ if (savedWriterPool) {
+ savedWriterPool->shutdown();
+ savedWriterPool->join();
+ }
}
BSONObj TenantMigrationRecipientService::Instance::_getOplogFetcherFilter() const {