diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2018-11-24 16:56:20 +0000 |
---|---|---|
committer | Bernard Gorman <bernard.gorman@gmail.com> | 2018-12-22 04:27:20 +0000 |
commit | fc5bc0947ceedee3b61b2d922cabd3e5df7ec07c (patch) | |
tree | 75749d0e4ff2d9db2001252018cc91e78801bc44 /src/mongo/db/commands/getmore_cmd.cpp | |
parent | bdac7ced24f9ad8f9afac9c57e7184b1f2bf61b2 (diff) | |
download | mongo-fc5bc0947ceedee3b61b2d922cabd3e5df7ec07c.tar.gz |
SERVER-38408 Return postBatchResumeToken with each mongoD change stream batch
Diffstat (limited to 'src/mongo/db/commands/getmore_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/getmore_cmd.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index e137a982ee7..ea669c4a209 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -233,8 +233,10 @@ public: // As soon as we get a result, this operation no longer waits. awaitDataState(opCtx).shouldWaitForInserts = false; - // Add result to output buffer. + // TODO SERVER-38539: We need to set both the latestOplogTimestamp and the + // postBatchResumeToken until the former is removed in a future release. nextBatch->setLatestOplogTimestamp(exec->getLatestOplogTimestamp()); + nextBatch->setPostBatchResumeToken(exec->getPostBatchResumeToken()); nextBatch->append(obj); (*numResults)++; } @@ -259,7 +261,10 @@ public: case PlanExecutor::IS_EOF: // This causes the reported latest oplog timestamp to advance even when there // are no results for this particular query. + // TODO SERVER-38539: We need to set both the latestOplogTimestamp and the + // postBatchResumeToken until the former is removed in a future release. nextBatch->setLatestOplogTimestamp(exec->getLatestOplogTimestamp()); + nextBatch->setPostBatchResumeToken(exec->getPostBatchResumeToken()); default: return Status::OK(); } |