summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/run_aggregate.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2023-04-04 11:26:53 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-04 17:16:13 +0000
commit2d5b6fb51af722de35c34678c8d146743bc52190 (patch)
tree451194fd2cacc75dbe16d2d67ab0a1c345d29f16 /src/mongo/db/commands/run_aggregate.cpp
parent05794b52523f287f828a8fa692ac3f3ed6cd5dd1 (diff)
downloadmongo-2d5b6fb51af722de35c34678c8d146743bc52190.tar.gz
SERVER-75265 Improve queryable encryption handling in curop
Diffstat (limited to 'src/mongo/db/commands/run_aggregate.cpp')
-rw-r--r--src/mongo/db/commands/run_aggregate.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp
index 6f503f0f850..c2f2701cd42 100644
--- a/src/mongo/db/commands/run_aggregate.cpp
+++ b/src/mongo/db/commands/run_aggregate.cpp
@@ -1012,10 +1012,13 @@ Status runAggregate(OperationContext* opCtx,
// support querying against encrypted fields.
if (shouldDoFLERewrite(request)) {
CurOp::get(opCtx)->debug().shouldOmitDiagnosticInformation = true;
- // After this rewriting, the encryption info does not need to be kept around.
- pipeline = processFLEPipelineD(
- opCtx, nss, request.getEncryptionInformation().value(), std::move(pipeline));
- request.setEncryptionInformation(boost::none);
+
+ if (!request.getEncryptionInformation()->getCrudProcessed().value_or(false)) {
+ pipeline = processFLEPipelineD(
+ opCtx, nss, request.getEncryptionInformation().value(), std::move(pipeline));
+ request.getEncryptionInformation()->setCrudProcessed(true);
+ }
+
// Set the telemetryStoreKey to none so telemetry isn't collected when we've done a FLE
// rewrite.
CurOp::get(opCtx)->debug().telemetryStoreKey = boost::none;