summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_cursor.cpp
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2018-11-24 16:56:20 +0000
committerBernard Gorman <bernard.gorman@gmail.com>2018-12-22 04:27:20 +0000
commitfc5bc0947ceedee3b61b2d922cabd3e5df7ec07c (patch)
tree75749d0e4ff2d9db2001252018cc91e78801bc44 /src/mongo/db/pipeline/document_source_cursor.cpp
parentbdac7ced24f9ad8f9afac9c57e7184b1f2bf61b2 (diff)
downloadmongo-fc5bc0947ceedee3b61b2d922cabd3e5df7ec07c.tar.gz
SERVER-38408 Return postBatchResumeToken with each mongoD change stream batch
Diffstat (limited to 'src/mongo/db/pipeline/document_source_cursor.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp
index cd0783eb5ac..b019bbf8e35 100644
--- a/src/mongo/db/pipeline/document_source_cursor.cpp
+++ b/src/mongo/db/pipeline/document_source_cursor.cpp
@@ -118,9 +118,9 @@ void DocumentSourceCursor::loadBatch() {
// As long as we're waiting for inserts, we shouldn't do any batching at this level
// we need the whole pipeline to see each document to see if we should stop waiting.
// Furthermore, if we need to return the latest oplog time (in the tailable and
- // needs-merge case), batching will result in a wrong time.
- if (awaitDataState(pExpCtx->opCtx).shouldWaitForInserts ||
- (pExpCtx->isTailableAwaitData() && pExpCtx->needsMerge) ||
+ // awaitData case), batching will result in a wrong time.
+ if (pExpCtx->isTailableAwaitData() ||
+ awaitDataState(pExpCtx->opCtx).shouldWaitForInserts ||
memUsageBytes > internalDocumentSourceCursorBatchSizeBytes.load()) {
// End this batch and prepare PlanExecutor for yielding.
_exec->saveState();