diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2015-08-24 23:51:27 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2015-08-24 23:51:27 -0400 |
commit | 764e0c45471d5ca63c708f362be0e6d01ee72eb0 (patch) | |
tree | 77c6693c1c1003d802a40a30eda8a79a4e0d7704 /src/mongo/db/commands/pipeline_command.cpp | |
parent | 564f8089c0d4541215d1aa31dae331115e68b95f (diff) | |
download | mongo-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.cpp | 7 |
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; } |