summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2021-01-14 12:29:57 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-29 23:37:38 +0000
commite5f0892d0d74eb4b90707a0fd5b19e3220a8344b (patch)
tree63fa311ac5d203458e5d0fdd3ccf5cae31d418b0 /src/mongo/db
parent9e2f8eb074db402f3d25264b7c0b299a95b81acc (diff)
downloadmongo-e5f0892d0d74eb4b90707a0fd5b19e3220a8344b.tar.gz
SERVER-51078 no need for checkForInterrupt in waitWhileFailPointEnabled
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/catalog/coll_mod.cpp2
-rw-r--r--src/mongo/db/catalog/list_indexes.cpp2
-rw-r--r--src/mongo/db/commands/count_cmd.cpp2
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp2
-rw-r--r--src/mongo/db/commands/list_collections.cpp8
-rw-r--r--src/mongo/db/curop_failpoint_helpers.cpp4
-rw-r--r--src/mongo/db/curop_failpoint_helpers.h9
-rw-r--r--src/mongo/db/ops/write_ops_exec.cpp11
-rw-r--r--src/mongo/db/query/find.cpp1
-rw-r--r--src/mongo/db/query/find_common.cpp1
10 files changed, 12 insertions, 30 deletions
diff --git a/src/mongo/db/catalog/coll_mod.cpp b/src/mongo/db/catalog/coll_mod.cpp
index ad1f541e86d..8ce5ccc000a 100644
--- a/src/mongo/db/catalog/coll_mod.cpp
+++ b/src/mongo/db/catalog/coll_mod.cpp
@@ -354,7 +354,7 @@ Status _collModInternal(OperationContext* opCtx,
Database* const db = coll.getDb();
CurOpFailpointHelpers::waitWhileFailPointEnabled(
- &hangAfterDatabaseLock, opCtx, "hangAfterDatabaseLock", []() {}, false, nss);
+ &hangAfterDatabaseLock, opCtx, "hangAfterDatabaseLock", []() {}, nss);
// May also modify a view instead of a collection.
boost::optional<ViewDefinition> view;
diff --git a/src/mongo/db/catalog/list_indexes.cpp b/src/mongo/db/catalog/list_indexes.cpp
index 8312e0f4998..49320f2ec65 100644
--- a/src/mongo/db/catalog/list_indexes.cpp
+++ b/src/mongo/db/catalog/list_indexes.cpp
@@ -72,7 +72,7 @@ std::list<BSONObj> listIndexesInLock(OperationContext* opCtx,
auto durableCatalog = DurableCatalog::get(opCtx);
CurOpFailpointHelpers::waitWhileFailPointEnabled(
- &hangBeforeListIndexes, opCtx, "hangBeforeListIndexes", []() {}, false, nss);
+ &hangBeforeListIndexes, opCtx, "hangBeforeListIndexes", []() {}, nss);
std::vector<std::string> indexNames;
writeConflictRetry(opCtx, "listIndexes", nss.ns(), [&] {
diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp
index efcc270186f..3bb4c6031f1 100644
--- a/src/mongo/db/commands/count_cmd.cpp
+++ b/src/mongo/db/commands/count_cmd.cpp
@@ -222,7 +222,7 @@ public:
const auto& nss = ctx->getNss();
CurOpFailpointHelpers::waitWhileFailPointEnabled(
- &hangBeforeCollectionCount, opCtx, "hangBeforeCollectionCount", []() {}, false, nss);
+ &hangBeforeCollectionCount, opCtx, "hangBeforeCollectionCount", []() {}, nss);
auto request = CountCommand::parse(IDLParserErrorContext("count"), cmdObj);
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index 3aab717b87c..3e64cc79090 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -499,7 +499,6 @@ public:
opCtx,
"waitAfterPinningCursorBeforeGetMoreBatch",
dropAndReacquireReadLock,
- false,
_request.nss);
}
@@ -605,7 +604,6 @@ public:
data["shouldNotdropLock"].booleanSafe()
? []() {} /*empty function*/
: saveAndRestoreStateWithReadLockReacquisition,
- false,
_request.nss);
});
diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp
index 9ff018b5eb2..4f914ec4279 100644
--- a/src/mongo/db/commands/list_collections.cpp
+++ b/src/mongo/db/commands/list_collections.cpp
@@ -305,12 +305,8 @@ public:
AutoGetDbForReadMaybeLockFree lockFreeReadBlock(opCtx, dbname);
auto viewCatalog = DatabaseHolder::get(opCtx)->getViewCatalog(opCtx, dbname);
- CurOpFailpointHelpers::waitWhileFailPointEnabled(&hangBeforeListCollections,
- opCtx,
- "hangBeforeListCollections",
- []() {},
- false,
- cursorNss);
+ CurOpFailpointHelpers::waitWhileFailPointEnabled(
+ &hangBeforeListCollections, opCtx, "hangBeforeListCollections", []() {}, cursorNss);
auto ws = std::make_unique<WorkingSet>();
auto root = std::make_unique<QueuedDataStage>(expCtx.get(), ws.get());
diff --git a/src/mongo/db/curop_failpoint_helpers.cpp b/src/mongo/db/curop_failpoint_helpers.cpp
index 91f6f66db4e..0f2ca39f371 100644
--- a/src/mongo/db/curop_failpoint_helpers.cpp
+++ b/src/mongo/db/curop_failpoint_helpers.cpp
@@ -48,15 +48,13 @@ void CurOpFailpointHelpers::waitWhileFailPointEnabled(FailPoint* failPoint,
OperationContext* opCtx,
const std::string& failpointMsg,
const std::function<void()>& whileWaiting,
- bool checkForInterrupt,
boost::optional<NamespaceString> nss) {
invariant(failPoint);
failPoint->executeIf(
[&](const BSONObj& data) {
auto origCurOpFailpointMsg = updateCurOpFailPointMsg(opCtx, failpointMsg);
- const bool shouldCheckForInterrupt =
- checkForInterrupt || data["shouldCheckForInterrupt"].booleanSafe();
+ const bool shouldCheckForInterrupt = data["shouldCheckForInterrupt"].booleanSafe();
const bool shouldContinueOnInterrupt = data["shouldContinueOnInterrupt"].booleanSafe();
while (MONGO_unlikely(failPoint->shouldFail())) {
sleepFor(Milliseconds(10));
diff --git a/src/mongo/db/curop_failpoint_helpers.h b/src/mongo/db/curop_failpoint_helpers.h
index 4a45d3a5cfa..c40a08d3440 100644
--- a/src/mongo/db/curop_failpoint_helpers.h
+++ b/src/mongo/db/curop_failpoint_helpers.h
@@ -51,18 +51,17 @@ public:
* failpoint. For example, the caller may use whileWaiting() to release and reacquire locks in
* order to avoid deadlocks.
*
- * If checkForInterrupt is false, the field "shouldCheckForInterrupt" may be set to 'true' at
- * runtime to cause this method to uassert on interrupt.
+ * The field "shouldCheckForInterrupt" may be set to 'true' at runtime to cause this method to
+ * uassert on interrupt.
*
* The field "shouldContinueOnInterrupt" may be set to 'true' to cause this method to continue
- * on interrupt without asserting, regardless of whether checkForInterrupt or the field
- * "shouldCheckForInterrupt" is set.
+ * on interrupt without asserting, regardless of whether the field "shouldCheckForInterrupt" is
+ * set.
*/
static void waitWhileFailPointEnabled(FailPoint* failPoint,
OperationContext* opCtx,
const std::string& failpointMsg,
const std::function<void()>& whileWaiting = nullptr,
- bool checkForInterrupt = false,
boost::optional<NamespaceString> nss = boost::none);
};
} // namespace mongo
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp
index e21c281c01b..db40954bc67 100644
--- a/src/mongo/db/ops/write_ops_exec.cpp
+++ b/src/mongo/db/ops/write_ops_exec.cpp
@@ -379,7 +379,6 @@ bool insertBatchAndHandleErrors(OperationContext* opCtx,
"Blocking until fail point is disabled",
"namespace"_attr = wholeOp.getNamespace());
},
- true, // Check for interrupt periodically.
wholeOp.getNamespace());
if (MONGO_unlikely(failAllInserts.shouldFail())) {
@@ -647,7 +646,6 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx,
"Blocking until fail point is disabled",
"namespace"_attr = ns);
},
- false /*checkForInterrupt*/,
ns);
if (MONGO_unlikely(failAllUpdates.shouldFail())) {
@@ -900,16 +898,11 @@ static SingleWriteResult performSingleDeleteOp(OperationContext* opCtx,
uassertStatusOK(parsedDelete.parseRequest());
CurOpFailpointHelpers::waitWhileFailPointEnabled(
- &hangDuringBatchRemove,
- opCtx,
- "hangDuringBatchRemove",
- []() {
+ &hangDuringBatchRemove, opCtx, "hangDuringBatchRemove", []() {
LOGV2(20891,
"Batch remove - hangDuringBatchRemove fail point enabled. Blocking until fail "
"point is disabled");
- },
- true // Check for interrupt periodically.
- );
+ });
if (MONGO_unlikely(failAllRemoves.shouldFail())) {
uasserted(ErrorCodes::InternalError, "failAllRemoves failpoint active!");
}
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 167812995ac..67e439e7e53 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -357,7 +357,6 @@ Message getMore(OperationContext* opCtx,
opCtx,
"waitAfterPinningCursorBeforeGetMoreBatch",
dropAndReaquireReadLock,
- false,
nss);
});
diff --git a/src/mongo/db/query/find_common.cpp b/src/mongo/db/query/find_common.cpp
index 20629f417c9..048683f677b 100644
--- a/src/mongo/db/query/find_common.cpp
+++ b/src/mongo/db/query/find_common.cpp
@@ -91,7 +91,6 @@ void FindCommon::waitInFindBeforeMakingBatch(OperationContext* opCtx, const Cano
opCtx,
"waitInFindBeforeMakingBatch",
std::move(whileWaitingFunc),
- /* checkForInterrupt = */ false,
cq.nss());
}
} // namespace mongo