summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2019-09-26 17:21:26 +0000
committerevergreen <evergreen@mongodb.com>2019-09-26 17:21:26 +0000
commit3197ace779d6e0f023bff9e39bd80e17e3c4790d (patch)
tree69aa8ccb7cc4ff00268c0941758de4648ff6201a /src/mongo/s/catalog
parentc0c70eafc57cbb6600cd843e4a3d42b8076b4de7 (diff)
downloadmongo-3197ace779d6e0f023bff9e39bd80e17e3c4790d.tar.gz
SERVER-36315 Don't keep trying to unlock distlocks after CSRS stepdown
Diffstat (limited to 'src/mongo/s/catalog')
-rw-r--r--src/mongo/s/catalog/replset_dist_lock_manager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/s/catalog/replset_dist_lock_manager.cpp b/src/mongo/s/catalog/replset_dist_lock_manager.cpp
index 7a422fea7ff..145b3423214 100644
--- a/src/mongo/s/catalog/replset_dist_lock_manager.cpp
+++ b/src/mongo/s/catalog/replset_dist_lock_manager.cpp
@@ -166,7 +166,10 @@ void ReplSetDistLockManager::doTask() {
if (!unlockStatus.isOK()) {
warning() << "Failed to unlock lock with " << LocksType::lockID() << ": "
<< toUnlock.first << nameMessage << causedBy(unlockStatus);
- queueUnlock(toUnlock.first, toUnlock.second);
+ // Queue another attempt, unless the problem was no longer being primary.
+ if (unlockStatus != ErrorCodes::NotMaster) {
+ queueUnlock(toUnlock.first, toUnlock.second);
+ }
} else {
LOG(0) << "distributed lock with " << LocksType::lockID() << ": "
<< toUnlock.first << nameMessage << " unlocked.";