diff options
Diffstat (limited to 'src/mongo/db/exec/write_stage_common.cpp')
-rw-r--r-- | src/mongo/db/exec/write_stage_common.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/exec/write_stage_common.cpp b/src/mongo/db/exec/write_stage_common.cpp index 8d48801f2db..570e1c3ec4f 100644 --- a/src/mongo/db/exec/write_stage_common.cpp +++ b/src/mongo/db/exec/write_stage_common.cpp @@ -46,8 +46,13 @@ bool ensureStillMatches(const Collection* collection, const CanonicalQuery* cq) { // If the snapshot changed, then we have to make sure we have the latest copy of the doc and // that it still matches. + // + // Storage engines that don't support document-level concurrency also do not track snapshot ids. + // Those storage engines always need to check whether the document still matches, as the + // document we are planning to delete may have already been deleted or updated during yield. WorkingSetMember* member = ws->get(id); - if (opCtx->recoveryUnit()->getSnapshotId() != member->obj.snapshotId()) { + if (!supportsDocLocking() || + opCtx->recoveryUnit()->getSnapshotId() != member->obj.snapshotId()) { std::unique_ptr<SeekableRecordCursor> cursor(collection->getCursor(opCtx)); if (!WorkingSetCommon::fetch(opCtx, ws, id, cursor)) { |