diff options
author | Eric Cox <eric.cox@mongodb.com> | 2021-07-21 19:03:16 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-07-31 01:41:48 +0000 |
commit | 07d6e82a05dbe36f94d6a32b9378b0ddabdc8045 (patch) | |
tree | 8d9666532e2a1f37805c81a87b758c21fe4d3c57 /src/mongo/db/query/find_common.cpp | |
parent | 63e3eaa766bf2aea4fad1333e69d7c8d52e612e8 (diff) | |
download | mongo-07d6e82a05dbe36f94d6a32b9378b0ddabdc8045.tar.gz |
SERVER-57461 Remove SPLIT_LIMITED_SORT and associated QueryPlanner code
Diffstat (limited to 'src/mongo/db/query/find_common.cpp')
-rw-r--r-- | src/mongo/db/query/find_common.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/query/find_common.cpp b/src/mongo/db/query/find_common.cpp index 4f34e0b1cf4..a6cb38186ca 100644 --- a/src/mongo/db/query/find_common.cpp +++ b/src/mongo/db/query/find_common.cpp @@ -59,14 +59,16 @@ const OperationContext::Decoration<AwaitDataState> awaitDataState = OperationContext::declareDecoration<AwaitDataState>(); bool FindCommon::enoughForFirstBatch(const FindCommandRequest& findCommand, long long numDocs) { - auto effectiveBatchSize = - findCommand.getBatchSize() ? findCommand.getBatchSize() : findCommand.getNtoreturn(); - if (!effectiveBatchSize) { + auto batchSize = findCommand.getBatchSize(); + tassert(5746104, + "ntoreturn on the find command should not be set", + findCommand.getNtoreturn() == boost::none); + if (!batchSize) { // We enforce a default batch size for the initial find if no batch size is specified. return numDocs >= query_request_helper::kDefaultBatchSize; } - return numDocs >= effectiveBatchSize.value(); + return numDocs >= batchSize.value(); } bool FindCommon::haveSpaceForNext(const BSONObj& nextDoc, long long numDocs, int bytesBuffered) { |