summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
diff options
context:
space:
mode:
authorKyle Suarez <ksuarz@gmail.com>2016-05-03 00:01:19 -0400
committerKyle Suarez <ksuarz@gmail.com>2016-05-03 00:01:19 -0400
commitf294d1dcd4884857d693b0f8a33cf1a6be434409 (patch)
tree8ba380d2b2b461f3b5459282e1ac7b51da56475b /src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
parent8abd5682f551ad79dec3557f721eebd45b21be0f (diff)
downloadmongo-f294d1dcd4884857d693b0f8a33cf1a6be434409.tar.gz
Revert "SERVER-23213 Remove all users of ShardRegistry::kAllRetriableErrors"
This reverts commit 21cfba12a005431b08a8c69dcdb1f262622ea780.
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, 1 insertions, 3 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 31fb999cdbf..4f4457c793b 100644
--- a/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
+++ b/src/mongo/s/catalog/replset/replset_dist_lock_manager.cpp
@@ -40,7 +40,6 @@
#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"
@@ -286,7 +285,6 @@ 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
@@ -320,7 +318,7 @@ StatusWith<DistLockManager::ScopedDistLock> ReplSetDistLockManager::lockWithSess
}
// If a network error occurred, unlock the lock synchronously and try again
- if (configShard->isRetriableError(status.code(), Shard::RetryPolicy::kIdempotent) &&
+ if (ShardRegistry::kAllRetriableErrors.count(status.code()) &&
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"