diff options
author | Pawel Terlecki <pawel.terlecki@mongodb.com> | 2019-02-01 18:43:03 -0500 |
---|---|---|
committer | Pawel Terlecki <pawel.terlecki@mongodb.com> | 2019-02-04 14:59:56 -0500 |
commit | 43b85b28d70b301c6f18dcfa7550b640191719e1 (patch) | |
tree | 95b3bcb5991508c8a20213309ec1b1db11280027 /src/mongo/db/query/find.cpp | |
parent | 8c157f05ea25f13595734b03b3c5b55cd16d7cd6 (diff) | |
download | mongo-43b85b28d70b301c6f18dcfa7550b640191719e1.tar.gz |
SERVER-38316 Consolidate PlanExecutor::DEAD and PlanExecutor::FAILURE
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.cpp | 11 |
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), |