diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2018-04-27 15:49:07 -0400 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2018-05-01 13:47:50 -0400 |
commit | 46f72213f60bd74367a11aec7f02b38780ae7c3a (patch) | |
tree | 45018ee4a9531cb973f6fbb96c321ef44774278c /src/mongo/db/exec/sort.cpp | |
parent | 0d097ebf4d5c78e77d789dad3f8a45a942d37d47 (diff) | |
download | mongo-46f72213f60bd74367a11aec7f02b38780ae7c3a.tar.gz |
SERVER-34725: Group and count plan stages do not set the WorkingSetID output on PlanStage::DEAD state
Diffstat (limited to 'src/mongo/db/exec/sort.cpp')
-rw-r--r-- | src/mongo/db/exec/sort.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp index bd2cc27e14f..243e8bf7a05 100644 --- a/src/mongo/db/exec/sort.cpp +++ b/src/mongo/db/exec/sort.cpp @@ -159,16 +159,10 @@ PlanStage::StageState SortStage::doWork(WorkingSetID* out) { _sorted = true; return PlanStage::NEED_TIME; } else if (PlanStage::FAILURE == code || PlanStage::DEAD == code) { + // The stage which produces a failure is responsible for allocating a working set member + // with error details. + invariant(WorkingSet::INVALID_ID != id); *out = id; - // If a stage fails, it may create a status WSM to indicate why it - // failed, in which case 'id' is valid. If ID is invalid, we - // create our own error message. - if (WorkingSet::INVALID_ID == id) { - mongoutils::str::stream ss; - ss << "sort stage failed to read in results to sort from child"; - Status status(ErrorCodes::InternalError, ss); - *out = WorkingSetCommon::allocateStatusMember(_ws, status); - } return code; } else if (PlanStage::NEED_YIELD == code) { *out = id; |