summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/pipeline_command.cpp
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2015-08-24 23:51:27 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2015-08-24 23:51:27 -0400
commit764e0c45471d5ca63c708f362be0e6d01ee72eb0 (patch)
tree77c6693c1c1003d802a40a30eda8a79a4e0d7704 /src/mongo/db/commands/pipeline_command.cpp
parent564f8089c0d4541215d1aa31dae331115e68b95f (diff)
downloadmongo-764e0c45471d5ca63c708f362be0e6d01ee72eb0.tar.gz
SERVER-16444 Copy data in the query subsystem as needed.
A WorkingSetMember in the LOC_AND_OBJ state must be made owned when: 1. Its WorkingSetID is cached across multiple calls to work(). 2. Multiple calls to next(), seekExact(), saveState(), etc. are performed on the same WiredTiger cursor in a single work() call. No longer necessary to always copy data out of WiredTiger buffers.
Diffstat (limited to 'src/mongo/db/commands/pipeline_command.cpp')
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index b348f8c3c84..0332d783266 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -98,11 +98,10 @@ static bool handleCursorCommand(OperationContext* txn,
break;
}
+ // If adding this object will cause us to exceed the BSON size limit, then we stash it for
+ // later.
if (resultsArray.len() + next.objsize() > byteLimit) {
- // Get the pipeline proxy stage wrapped by this PlanExecutor.
- PipelineProxyStage* proxy = static_cast<PipelineProxyStage*>(exec->getRootStage());
- // too big. next will be the first doc in the second batch
- proxy->pushBack(next);
+ exec->enqueue(next);
break;
}