Skip to content

Commit e1298b7

Browse files
erweeEvergreen Agent
authored andcommitted
SERVER-83429 Fix retryable FLE2 update & findAndModify failing on retry if document is removed
1 parent 6886493 commit e1298b7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mongo/db/fle_crud.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,11 @@ write_ops::UpdateCommandReply processUpdate(FLEQueryInterface* queryImpl,
11011101
return updateReply;
11021102
}
11031103

1104+
// If this is a retried write, we are done
1105+
if (updateReply.getWriteCommandReplyBase().getRetriedStmtIds().has_value()) {
1106+
return updateReply;
1107+
}
1108+
11041109
// If there are errors, we are done
11051110
if (updateReply.getWriteErrors().has_value() && !updateReply.getWriteErrors().value().empty()) {
11061111
return updateReply;
@@ -1371,6 +1376,11 @@ write_ops::FindAndModifyCommandReply processFindAndModify(
13711376
return reply;
13721377
}
13731378

1379+
// If this is a retried write, we are done
1380+
if (reply.getRetriedStmtId()) {
1381+
return reply;
1382+
}
1383+
13741384
// Step 4 ----
13751385
BSONObj originalDocument = reply.getValue().value();
13761386
auto idElement = originalDocument.firstElement();

0 commit comments

Comments
 (0)