summaryrefslogtreecommitdiff
path: root/src/mongo/db/fle_crud.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2022-03-16 22:11:47 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-22 15:19:41 +0000
commit992cb26e58bee172a2afd178cfa671013aad2491 (patch)
tree716b4fd7c44e8bc1095c2d59c4c49f0033456984 /src/mongo/db/fle_crud.h
parent3802a06137db53dfba0976405104ec1db11dec68 (diff)
downloadmongo-992cb26e58bee172a2afd178cfa671013aad2491.tar.gz
SERVER-63717 Add support for FLE 2 delete in MongoD
Diffstat (limited to 'src/mongo/db/fle_crud.h')
-rw-r--r--src/mongo/db/fle_crud.h40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/mongo/db/fle_crud.h b/src/mongo/db/fle_crud.h
index b26e76703ae..37eeaaf96b9 100644
--- a/src/mongo/db/fle_crud.h
+++ b/src/mongo/db/fle_crud.h
@@ -87,6 +87,14 @@ void stopFLECrud();
FLEBatchResult processFLEInsert(OperationContext* opCtx,
const write_ops::InsertCommandRequest& insertRequest,
write_ops::InsertCommandReply* insertReply);
+
+/**
+ * Process a replica set delete.
+ */
+write_ops::DeleteCommandReply processFLEDelete(
+ OperationContext* opCtx, const write_ops::DeleteCommandRequest& deleteRequest);
+
+
/**
* Process a findAndModify request from mongos
*/
@@ -132,9 +140,10 @@ public:
* Returns the pre-image of the deleted document. If no documents were deleted, returns an empty
* BSON object.
*/
- virtual BSONObj deleteWithPreimage(const NamespaceString& nss,
- const EncryptionInformation& ei,
- const write_ops::DeleteCommandRequest& deleteRequest) = 0;
+ virtual std::pair<write_ops::DeleteCommandReply, BSONObj> deleteWithPreimage(
+ const NamespaceString& nss,
+ const EncryptionInformation& ei,
+ const write_ops::DeleteCommandRequest& deleteRequest) = 0;
/**
* Update a single document with the given query and update operators.
@@ -175,8 +184,8 @@ StatusWith<write_ops::InsertCommandReply> processInsert(
*
* Used by unit tests.
*/
-uint64_t processDelete(FLEQueryInterface* queryImpl,
- const write_ops::DeleteCommandRequest& deleteRequest);
+write_ops::DeleteCommandReply processDelete(FLEQueryInterface* queryImpl,
+ const write_ops::DeleteCommandRequest& deleteRequest);
/**
* Process a FLE Update with the query interface
@@ -187,6 +196,15 @@ write_ops::UpdateCommandReply processUpdate(FLEQueryInterface* queryImpl,
const write_ops::UpdateCommandRequest& updateRequest);
/**
+ * Process a FLE Find And Modify with the query interface
+ *
+ * Used by unit tests.
+ */
+write_ops::FindAndModifyCommandReply processFindAndModify(
+ FLEQueryInterface* queryImpl,
+ const write_ops::FindAndModifyCommandRequest& findAndModifyRequest);
+
+/**
* Callback function to get a TransactionWithRetries with the appropiate Executor
*/
using GetTxnCallback =
@@ -197,13 +215,7 @@ std::pair<FLEBatchResult, write_ops::InsertCommandReply> processInsert(
const write_ops::InsertCommandRequest& insertRequest,
GetTxnCallback getTxns);
-/**
- * Process a FLE Find And Modify with the query interface
- *
- * Used by unit tests.
- */
-write_ops::FindAndModifyCommandReply processFindAndModify(
- FLEQueryInterface* queryImpl,
- const write_ops::FindAndModifyCommandRequest& findAndModifyRequest);
-
+write_ops::DeleteCommandReply processDelete(OperationContext* opCtx,
+ const write_ops::DeleteCommandRequest& deleteRequest,
+ GetTxnCallback getTxns);
} // namespace mongo