summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/find.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/find.cpp')
-rw-r--r--src/mongo/db/query/find.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 65816afeef4..2f351c930d3 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -248,7 +248,7 @@ Message getMore(OperationContext* opCtx,
curOp.ensureStarted();
// For testing, we may want to fail if we receive a getmore.
- if (MONGO_FAIL_POINT(failReceivedGetmore)) {
+ if (MONGO_unlikely(failReceivedGetmore.shouldFail())) {
MONGO_UNREACHABLE;
}
@@ -369,8 +369,7 @@ Message getMore(OperationContext* opCtx,
// repeatedly release and re-acquire the collection readLock at regular intervals until
// the failpoint is released. This is done in order to avoid deadlocks caused by the
// pinned-cursor failpoints in this file (see SERVER-21997).
- MONGO_FAIL_POINT_BLOCK(waitAfterPinningCursorBeforeGetMoreBatch, options) {
- const BSONObj& data = options.getData();
+ waitAfterPinningCursorBeforeGetMoreBatch.execute([&](const BSONObj& data) {
if (data["shouldNotdropLock"].booleanSafe()) {
dropAndReaquireReadLock = []() {};
}
@@ -381,7 +380,7 @@ Message getMore(OperationContext* opCtx,
dropAndReaquireReadLock,
false,
nss);
- }
+ });
const auto replicationMode = repl::ReplicationCoordinator::get(opCtx)->getReplicationMode();
@@ -459,7 +458,7 @@ Message getMore(OperationContext* opCtx,
// accumulate over the course of a cursor's lifetime.
PlanSummaryStats preExecutionStats;
Explain::getSummaryStats(*exec, &preExecutionStats);
- if (MONGO_FAIL_POINT(waitWithPinnedCursorDuringGetMoreBatch)) {
+ if (MONGO_unlikely(waitWithPinnedCursorDuringGetMoreBatch.shouldFail())) {
CurOpFailpointHelpers::waitWhileFailPointEnabled(&waitWithPinnedCursorDuringGetMoreBatch,
opCtx,
"waitWithPinnedCursorDuringGetMoreBatch",
@@ -548,7 +547,7 @@ Message getMore(OperationContext* opCtx,
// If the 'waitBeforeUnpinningOrDeletingCursorAfterGetMoreBatch' failpoint is active, we
// set the 'msg' field of this operation's CurOp to signal that we've hit this point and
// then spin until the failpoint is released.
- if (MONGO_FAIL_POINT(waitBeforeUnpinningOrDeletingCursorAfterGetMoreBatch)) {
+ if (MONGO_unlikely(waitBeforeUnpinningOrDeletingCursorAfterGetMoreBatch.shouldFail())) {
CurOpFailpointHelpers::waitWhileFailPointEnabled(
&waitBeforeUnpinningOrDeletingCursorAfterGetMoreBatch,
opCtx,