summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavis Haupt <davis.haupt@mongodb.com>2022-05-11 16:00:07 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-13 00:21:27 +0000
commit465ca1e4592f08f940e311b7852efe6147077486 (patch)
treede8a5657efccd1ab2f448bcfe01e52c8be5b051a
parent1abb269878e6514dc21a2478d33f185d92d24aa2 (diff)
downloadmongo-465ca1e4592f08f940e311b7852efe6147077486.tar.gz
SERVER-66366 remove encryptionInformation after rewriting update and delete requests for explain commands
-rw-r--r--src/mongo/db/fle_crud.cpp2
-rw-r--r--src/mongo/s/commands/cluster_write_cmd.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/fle_crud.cpp b/src/mongo/db/fle_crud.cpp
index 3cdaa83e8a8..1b2d86c0bff 100644
--- a/src/mongo/db/fle_crud.cpp
+++ b/src/mongo/db/fle_crud.cpp
@@ -963,6 +963,7 @@ std::unique_ptr<BatchedCommandRequest> processFLEBatchExplain(
newDeleteOp.getQ(),
&getTransactionWithRetriesForMongoS));
deleteRequest.setDeletes({newDeleteOp});
+ deleteRequest.getWriteCommandRequestBase().setEncryptionInformation(boost::none);
return std::make_unique<BatchedCommandRequest>(deleteRequest);
} else if (request.getBatchType() == BatchedCommandRequest::BatchType_Update) {
auto updateRequest = request.getUpdateRequest();
@@ -974,6 +975,7 @@ std::unique_ptr<BatchedCommandRequest> processFLEBatchExplain(
newUpdateOp.getQ(),
&getTransactionWithRetriesForMongoS));
updateRequest.setUpdates({newUpdateOp});
+ updateRequest.getWriteCommandRequestBase().setEncryptionInformation(boost::none);
return std::make_unique<BatchedCommandRequest>(updateRequest);
}
MONGO_UNREACHABLE;
diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp
index e35117313b4..10d04ba0b82 100644
--- a/src/mongo/s/commands/cluster_write_cmd.cpp
+++ b/src/mongo/s/commands/cluster_write_cmd.cpp
@@ -653,6 +653,9 @@ void ClusterWriteCmd::InvocationBase::explain(OperationContext* opCtx,
(_batchedRequest.getBatchType() == BatchedCommandRequest::BatchType_Delete ||
_batchedRequest.getBatchType() == BatchedCommandRequest::BatchType_Update)) {
req = processFLEBatchExplain(opCtx, _batchedRequest);
+ tassert(6636600,
+ "encryptionInformation should be stripped from request after rewriting for explain",
+ !req->hasEncryptionInformation());
}
auto nss = req ? req->getNS() : _batchedRequest.getNS();