summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-10-26 17:21:58 -0400
committerDavid Storch <david.storch@10gen.com>2018-10-31 17:26:35 -0400
commitd6c618fc94ebdfdba5d270e396a084290a54d360 (patch)
tree81f42ec3ebe8522ebbca4e95a6c1615fccfbdb26 /src/mongo/db/commands
parent5180b48eedec5e57e7f12f734d173184bbff2af7 (diff)
downloadmongo-d6c618fc94ebdfdba5d270e396a084290a54d360.tar.gz
SERVER-37444 Added RequiresCollectionStage and use for COLLSCAN.
This is a pure refactor with no user-facing changes. It is the first step in making PlanExecutors check their own validity during yield recovery, rather than requiring the invalidating actor to issue a kill notification.
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/collection_to_capped.cpp6
-rw-r--r--src/mongo/db/commands/dbcommands_d.cpp8
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp2
-rw-r--r--src/mongo/db/commands/mr.cpp5
4 files changed, 7 insertions, 14 deletions
diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp
index a7b3530d0e9..816882ad0fb 100644
--- a/src/mongo/db/commands/collection_to_capped.cpp
+++ b/src/mongo/db/commands/collection_to_capped.cpp
@@ -135,9 +135,7 @@ public:
str::stream() << "database " << dbname << " not found");
}
- Status status =
- cloneCollectionAsCapped(opCtx, db, from.toString(), to.toString(), size, temp);
- uassertStatusOK(status);
+ cloneCollectionAsCapped(opCtx, db, from.toString(), to.toString(), size, temp);
return true;
}
} cmdCloneCollectionAsCapped;
@@ -180,7 +178,7 @@ public:
return false;
}
- uassertStatusOK(convertToCapped(opCtx, nss, size));
+ convertToCapped(opCtx, nss, size);
return true;
}
diff --git a/src/mongo/db/commands/dbcommands_d.cpp b/src/mongo/db/commands/dbcommands_d.cpp
index 111b693e865..7c715eeacb4 100644
--- a/src/mongo/db/commands/dbcommands_d.cpp
+++ b/src/mongo/db/commands/dbcommands_d.cpp
@@ -315,12 +315,8 @@ public:
break;
}
- // Have the lock again. See if we were killed.
- if (!exec->restoreState().isOK()) {
- if (!partialOk) {
- uasserted(13281, "File deleted during filemd5 command");
- }
- }
+ // Now that we have the lock again, we can restore the PlanExecutor.
+ exec->restoreState();
}
if (PlanExecutor::DEAD == state || PlanExecutor::FAILURE == state) {
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index d3484500099..31b465475de 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -411,7 +411,7 @@ public:
PlanExecutor* exec = cursor->getExecutor();
exec->reattachToOperationContext(opCtx);
- uassertStatusOK(exec->restoreState());
+ exec->restoreState();
auto planSummary = Explain::getPlanSummary(exec);
{
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 7fca7451fb9..9b039f98e96 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -1207,7 +1207,7 @@ void State::finalReduce(OperationContext* opCtx, CurOp* curOp, ProgressMeterHold
all.push_back(o);
_opCtx->checkForInterrupt();
- uassertStatusOK(exec->restoreState());
+ exec->restoreState();
}
uassert(34428,
@@ -1553,8 +1553,7 @@ public:
state.reduceAndSpillInMemoryStateIfNeeded();
scopedAutoColl.emplace(opCtx, config.nss, MODE_S);
- auto restoreStatus = exec->restoreState();
- uassertStatusOK(restoreStatus);
+ exec->restoreState();
reduceTime += t.micros();