diff options
author | Alberto Massari <alberto.massari@mongodb.com> | 2022-09-13 08:43:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-13 09:35:57 +0000 |
commit | c70bc17083cc73c2b2d32b4fc693fe22c58a863d (patch) | |
tree | c04df9e948c2f1f3b4ce9691a56a9095c14672a4 /src/mongo/db/commands | |
parent | 5a6d6a46b809a2a35099b18e1ee693e70a67f28d (diff) | |
download | mongo-c70bc17083cc73c2b2d32b4fc693fe22c58a863d.tar.gz |
SERVER-63851 Derive ExecutionContext flags from OperationContext
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/map_reduce_agg.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/run_aggregate.cpp | 9 |
3 files changed, 2 insertions, 15 deletions
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index bf40647a9cf..ba45ad6b615 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -142,10 +142,6 @@ boost::intrusive_ptr<ExpressionContext> makeExpressionContext( findCommand.getLet(), // let CurOp::get(opCtx)->dbProfileLevel() > 0 // mayDbProfile ); - if (opCtx->readOnly()) { - // Disallow disk use if in read-only mode. - expCtx->allowDiskUse = false; - } expCtx->tempDir = storageGlobalParams.dbpath + "/_tmp"; expCtx->startExpressionCounters(); diff --git a/src/mongo/db/commands/map_reduce_agg.cpp b/src/mongo/db/commands/map_reduce_agg.cpp index 073e655dcb3..1f31ec3c78f 100644 --- a/src/mongo/db/commands/map_reduce_agg.cpp +++ b/src/mongo/db/commands/map_reduce_agg.cpp @@ -107,10 +107,6 @@ auto makeExpressionContext(OperationContext* opCtx, boost::none, // let CurOp::get(opCtx)->dbProfileLevel() > 0 // mayDbProfile ); - if (opCtx->readOnly()) { - // Disallow disk use if in read-only mode. - expCtx->allowDiskUse = false; - } expCtx->tempDir = storageGlobalParams.dbpath + "/_tmp"; return expCtx; } diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index e61f799620c..4fe8a736ad7 100644 --- a/src/mongo/db/commands/run_aggregate.cpp +++ b/src/mongo/db/commands/run_aggregate.cpp @@ -443,15 +443,10 @@ boost::intrusive_ptr<ExpressionContext> makeExpressionContext( MongoProcessInterface::create(opCtx), uassertStatusOK(resolveInvolvedNamespaces(opCtx, request)), uuid, - CurOp::get(opCtx)->dbProfileLevel() > 0); + CurOp::get(opCtx)->dbProfileLevel() > 0, + allowDiskUseByDefault.load()); expCtx->tempDir = storageGlobalParams.dbpath + "/_tmp"; expCtx->collationMatchesDefault = collationMatchesDefault; - expCtx->forPerShardCursor = request.getPassthroughToShard().has_value(); - expCtx->allowDiskUse = request.getAllowDiskUse().value_or(allowDiskUseByDefault.load()); - if (opCtx->readOnly()) { - // Disallow disk use if in read-only mode. - expCtx->allowDiskUse = false; - } // If the request explicitly specified NOT to use v2 resume tokens for change streams, set this // on the expCtx. This can happen if a the request originated from 6.0 mongos, or in test mode. |