summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-05-10 15:50:48 -0400
committerjannaerin <golden.janna@gmail.com>2018-05-14 17:13:52 -0400
commit06f338d1c9bdce2f5eecd4162a0200eb8c444571 (patch)
treebc6267adb53a7656aec5b5fe889346de0c1a7b59 /src/mongo
parenta6a56bb730d99a0ec88d459d24e33a993806f666 (diff)
downloadmongo-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.cpp14
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) {