summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/legacy
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@10gen.com>2015-09-29 19:10:49 -0400
committerEsha Maharishi <esha.maharishi@10gen.com>2015-09-29 19:10:49 -0400
commita2da29e9188b27bdff7b63db21720390b4a98d01 (patch)
tree3652652eee0805244bf1a38570af9ee155cd055d /src/mongo/s/catalog/legacy
parent1f34fa3204a4212ee724c330331bdef7ad3a4c44 (diff)
downloadmongo-a2da29e9188b27bdff7b63db21720390b4a98d01.tar.gz
SERVER-20654 create fail point to make distributed lock timeout 10 minutes for dropCollection
Diffstat (limited to 'src/mongo/s/catalog/legacy')
-rw-r--r--src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp b/src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp
index 10ecc61f927..74b72e22f95 100644
--- a/src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp
+++ b/src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp
@@ -75,6 +75,7 @@
#include "mongo/s/shard_key_pattern.h"
#include "mongo/s/write_ops/batched_command_request.h"
#include "mongo/s/write_ops/batched_command_response.h"
+#include "mongo/util/fail_point_service.h"
#include "mongo/util/mongoutils/str.h"
#include "mongo/util/net/hostandport.h"
#include "mongo/util/log.h"
@@ -83,6 +84,8 @@
namespace mongo {
+MONGO_FP_DECLARE(setSCCCDropCollDistLockWait);
+
using std::set;
using std::shared_ptr;
using std::string;
@@ -555,7 +558,11 @@ Status CatalogManagerLegacy::dropCollection(OperationContext* txn, const Namespa
LOG(1) << "dropCollection " << ns << " started";
// Lock the collection globally so that split/migrate cannot run
- const stdx::chrono::seconds waitFor(2);
+ stdx::chrono::seconds waitFor(2);
+ MONGO_FAIL_POINT_BLOCK(setSCCCDropCollDistLockWait, customWait) {
+ const BSONObj& data = customWait.getData();
+ waitFor = stdx::chrono::seconds(data["waitForSecs"].numberInt());
+ }
const stdx::chrono::milliseconds lockTryInterval(500);
auto scopedDistLock = getDistLockManager()->lock(ns.ns(), "drop", waitFor, lockTryInterval);
if (!scopedDistLock.isOK()) {