summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2016-05-03 11:28:57 -0400
committerSpencer T Brody <spencer@mongodb.com>2016-05-03 18:57:26 -0400
commit595d7d795f443cf4e848d8044d4102363b4870d2 (patch)
tree85477547e7d6270b87ab68d5381bac1fcb94aa43 /src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
parent9fab79e546604a74d577bbc1672e78d4bf849e82 (diff)
downloadmongo-595d7d795f443cf4e848d8044d4102363b4870d2.tar.gz
SERVER-23213 Remove all users of ShardRegistry::kAllRetriableErrors
This reverts commit f294d1dcd4884857d693b0f8a33cf1a6be434409.
Diffstat (limited to 'src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp')
-rw-r--r--src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp b/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
index 4f4457c793b..31fb999cdbf 100644
--- a/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
+++ b/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
@@ -40,6 +40,7 @@
#include "mongo/s/catalog/type_lockpings.h"
#include "mongo/s/catalog/type_locks.h"
#include "mongo/s/client/shard_registry.h"
+#include "mongo/s/grid.h"
#include "mongo/stdx/chrono.h"
#include "mongo/stdx/memory.h"
#include "mongo/util/concurrency/thread_name.h"
@@ -285,6 +286,7 @@ StatusWith<DistLockManager::ScopedDistLock> ReplSetDistLockManager::lockWithSess
// independent write operations.
int networkErrorRetries = 0;
+ auto configShard = Grid::get(txn)->shardRegistry()->getConfigShard();
// Distributed lock acquisition works by tring to update the state of the lock to 'taken'. If
// the lock is currently taken, we will back off and try the acquisition again, repeating this
// until the lockTryInterval has been reached. If a network error occurs at each lock
@@ -318,7 +320,7 @@ StatusWith<DistLockManager::ScopedDistLock> ReplSetDistLockManager::lockWithSess
}
// If a network error occurred, unlock the lock synchronously and try again
- if (ShardRegistry::kAllRetriableErrors.count(status.code()) &&
+ if (configShard->isRetriableError(status.code(), Shard::RetryPolicy::kIdempotent) &&
networkErrorRetries < kMaxNumLockAcquireRetries) {
LOG(1) << "Failed to acquire distributed lock because of retriable error. Retrying "
"acquisition by first unlocking the stale entry, which possibly exists now"