summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/find.cpp
diff options
context:
space:
mode:
authorPawel Terlecki <pawel.terlecki@mongodb.com>2019-02-01 18:43:03 -0500
committerPawel Terlecki <pawel.terlecki@mongodb.com>2019-02-04 12:12:18 -0500
commitbd6d9a07a669891f18d0fb6a0f9b1535a6f13524 (patch)
tree0aa2e637f688584edf5d38536135c9ceddcf81b7 /src/mongo/db/query/find.cpp
parent2d242bb2fd988496cbbe01ad17304778b441319a (diff)
downloadmongo-bd6d9a07a669891f18d0fb6a0f9b1535a6f13524.tar.gz
SERVER-38316 Consolidate PlanExecutor::DEAD and PlanExecutor::FAILURESERVER-38316
Takes care of PlanExecutor states. In some cases we log more information for former DEAD state scenarios now.
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 d6e4ce7a1e0..da3ff98fb0c 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -84,7 +84,7 @@ bool shouldSaveCursor(OperationContext* opCtx,
const Collection* collection,
PlanExecutor::ExecState finalState,
PlanExecutor* exec) {
- if (PlanExecutor::FAILURE == finalState || PlanExecutor::DEAD == finalState) {
+ if (PlanExecutor::FAILURE == finalState) {
return false;
}
@@ -109,7 +109,7 @@ bool shouldSaveCursor(OperationContext* opCtx,
bool shouldSaveCursorGetMore(PlanExecutor::ExecState finalState,
PlanExecutor* exec,
bool isTailable) {
- if (PlanExecutor::FAILURE == finalState || PlanExecutor::DEAD == finalState) {
+ if (PlanExecutor::FAILURE == finalState) {
return false;
}
@@ -199,11 +199,10 @@ void generateBatch(int ntoreturn,
// Propagate any errors to the caller.
switch (*state) {
- // Log an error message and then perform the same cleanup as DEAD.
- case PlanExecutor::FAILURE:
+ // Log an error message and then perform the cleanup.
+ case PlanExecutor::FAILURE: {
error() << "getMore executor error, stats: "
<< redact(Explain::getWinningPlanStats(exec));
- case PlanExecutor::DEAD: {
// We should always have a valid status object by this point.
auto status = WorkingSetCommon::getMemberObjectStatus(obj);
invariant(!status.isOK());
@@ -646,7 +645,7 @@ std::string runQuery(OperationContext* opCtx,
}
// Caller expects exceptions thrown in certain cases.
- if (PlanExecutor::FAILURE == state || PlanExecutor::DEAD == state) {
+ if (PlanExecutor::FAILURE == state) {
error() << "Plan executor error during find: " << PlanExecutor::statestr(state)
<< ", stats: " << redact(Explain::getWinningPlanStats(exec.get()));
uassertStatusOKWithContext(WorkingSetCommon::getMemberObjectStatus(obj),