diff options
author | jannaerin <golden.janna@gmail.com> | 2018-05-10 15:50:48 -0400 |
---|---|---|
committer | jannaerin <golden.janna@gmail.com> | 2018-05-14 17:13:52 -0400 |
commit | 06f338d1c9bdce2f5eecd4162a0200eb8c444571 (patch) | |
tree | bc6267adb53a7656aec5b5fe889346de0c1a7b59 /src/mongo | |
parent | a6a56bb730d99a0ec88d459d24e33a993806f666 (diff) | |
download | mongo-06f338d1c9bdce2f5eecd4162a0200eb8c444571.tar.gz |
SERVER-34796 Make _cleanup in movePrimary only clear the DSS if the db exists
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/s/move_primary_source_manager.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mongo/db/s/move_primary_source_manager.cpp b/src/mongo/db/s/move_primary_source_manager.cpp index 6af77e7b492..2bfd92cedfb 100644 --- a/src/mongo/db/s/move_primary_source_manager.cpp +++ b/src/mongo/db/s/move_primary_source_manager.cpp @@ -349,16 +349,12 @@ void MovePrimarySourceManager::_cleanup(OperationContext* opCtx) { UninterruptibleLockGuard noInterrupt(opCtx->lockState()); AutoGetDb autoDb(opCtx, getNss().toString(), MODE_X); - if (!autoDb.getDb()) { - uasserted(ErrorCodes::ConflictingOperationInProgress, - str::stream() << "The database " << getNss().toString() - << " was dropped during the movePrimary operation."); - } - - DatabaseShardingState::get(autoDb.getDb()).clearMovePrimarySourceManager(opCtx); + if (autoDb.getDb()) { + DatabaseShardingState::get(autoDb.getDb()).clearMovePrimarySourceManager(opCtx); - // Leave the critical section if we're still registered. - DatabaseShardingState::get(autoDb.getDb()).exitCriticalSection(opCtx, boost::none); + // Leave the critical section if we're still registered. + DatabaseShardingState::get(autoDb.getDb()).exitCriticalSection(opCtx, boost::none); + } } if (_state == kCriticalSection || _state == kCloneCompleted) { |