diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2022-04-11 17:09:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-11 23:28:08 +0000 |
commit | 9f0897f74297a4ae415a3b5ebf482ff78afc2058 (patch) | |
tree | 9829721a2bcded15f410b23a8af5962bfd5e6a2d /src/mongo/db/commands | |
parent | bbb9ba057afddf16a714c3c39688bee9fe8ccb56 (diff) | |
download | mongo-9f0897f74297a4ae415a3b5ebf482ff78afc2058.tar.gz |
SERVER-65282 Add $_generateV2ResumeTokens parameter to aggregate command
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/run_aggregate.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index e21bcfbffdf..127898b875e 100644 --- a/src/mongo/db/commands/run_aggregate.cpp +++ b/src/mongo/db/commands/run_aggregate.cpp @@ -442,6 +442,14 @@ boost::intrusive_ptr<ExpressionContext> makeExpressionContext( expCtx->collationMatchesDefault = collationMatchesDefault; expCtx->forPerShardCursor = request.getPassthroughToShard().has_value(); + // 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(6528200, "Invalid request for v2 resume tokens", getTestCommandsEnabled()); + expCtx->changeStreamTokenVersion = 2; + } + return expCtx; } |