diff options
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r-- | src/mongo/db/db_raii.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index d85146c06d2..e4259bb33a3 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -1321,6 +1321,13 @@ AutoGetCollectionForReadLockFreePITCatalog::AutoGetCollectionForReadLockFreePITC _lockFreeReadsBlock.reset(); } _collectionPtr = std::move(collection); + // Nested operations should never yield as we don't yield when the global lock is held + // recursively. But this is not known when we create the Query plan for this sub operation. + // Pretend that we are yieldable but don't allow yield to actually be called. + _collectionPtr.makeYieldable(opCtx, [](OperationContext*, UUID) { + MONGO_UNREACHABLE; + return nullptr; + }); } else { auto catalogStateForNamespace = acquireCatalogStateForNamespace(opCtx, |