@@ -688,21 +688,10 @@ StatusWith<std::vector<BSONObj>> _findOrDeleteDocuments(
688688 BoundInclusion boundInclusion,
689689 std::size_t limit,
690690 FindDeleteMode mode) {
691- auto isFind = mode == FindDeleteMode::kFind ;
691+ const bool isFind = mode == FindDeleteMode::kFind ;
692692 auto opStr = isFind ? " StorageInterfaceImpl::find" : " StorageInterfaceImpl::delete" ;
693693
694- #ifdef MONGO_CONFIG_DEBUG_BUILD
695- // TODO SERVER-114535: If a lock-free read is active and we enter this function the operation
696- // could force us to abandon the snapshot opened. This could cause the acquisition held above
697- // this call to become invalid by accident. We disable the checks temporarily until a more
698- // permanent fix is in place.
699- boost::optional<DisableCollectionConsistencyChecks> disableChecks;
700- if (isFind) {
701- disableChecks.emplace (opCtx);
702- }
703- #endif
704-
705- return writeConflictRetry (opCtx, opStr, nsOrUUID, [&]() -> StatusWith<std::vector<BSONObj>> {
694+ auto doFindOrDeleteDocuments = [&]() -> StatusWith<std::vector<BSONObj>> {
706695 // We need to explicitly use this in a few places to help the type inference. Use a
707696 // shorthand.
708697 using Result = StatusWith<std::vector<BSONObj>>;
@@ -878,7 +867,10 @@ StatusWith<std::vector<BSONObj>> _findOrDeleteDocuments(
878867 }
879868
880869 return Result{docs};
881- });
870+ };
871+
872+ return isFind ? doFindOrDeleteDocuments ()
873+ : writeConflictRetry (opCtx, opStr, nsOrUUID, doFindOrDeleteDocuments);
882874}
883875
884876StatusWith<BSONObj> _findOrDeleteById (OperationContext* opCtx,
0 commit comments