summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_aggregate.cpp
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2022-04-11 17:09:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-11 23:28:08 +0000
commit9f0897f74297a4ae415a3b5ebf482ff78afc2058 (patch)
tree9829721a2bcded15f410b23a8af5962bfd5e6a2d /src/mongo/s/query/cluster_aggregate.cpp
parentbbb9ba057afddf16a714c3c39688bee9fe8ccb56 (diff)
downloadmongo-9f0897f74297a4ae415a3b5ebf482ff78afc2058.tar.gz
SERVER-65282 Add $_generateV2ResumeTokens parameter to aggregate command
Diffstat (limited to 'src/mongo/s/query/cluster_aggregate.cpp')
-rw-r--r--src/mongo/s/query/cluster_aggregate.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/s/query/cluster_aggregate.cpp b/src/mongo/s/query/cluster_aggregate.cpp
index 4bcd150206b..b3df71582da 100644
--- a/src/mongo/s/query/cluster_aggregate.cpp
+++ b/src/mongo/s/query/cluster_aggregate.cpp
@@ -133,6 +133,14 @@ boost::intrusive_ptr<ExpressionContext> makeExpressionContext(
mergeCtx->inMongos = true;
+ // If the request specified v2 resume tokens for change streams, set this on the expCtx. On 6.0
+ // we only expect this to occur during testing.
+ // TODO SERVER-65370: after 6.0, assume true unless present and explicitly false.
+ if (request.getGenerateV2ResumeTokens()) {
+ uassert(6528201, "Invalid request for v2 resume tokens", getTestCommandsEnabled());
+ mergeCtx->changeStreamTokenVersion = 2;
+ }
+
// Serialize the 'AggregateCommandRequest' and save it so that the original command can be
// reconstructed for dispatch to a new shard, which is sometimes necessary for change streams
// pipelines.