From 55877fcfb5e8ac0b23f65862cd1d2f9b439c07f6 Mon Sep 17 00:00:00 2001 From: Louis Williams Date: Tue, 25 Apr 2023 14:11:05 +0000 Subject: SERVER-70338 Abandon snapshot while holding locks during query yield * Alters the Locker contract to require callers to check if they can yield locks before yielding * Reverses the ordering of yielding such that the snapshot is released before releasing locks * Refactors the PlanYieldPolicy to allow it to override the requested YieldPolicy if necessary --- src/mongo/db/update/update_util.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mongo/db/update') diff --git a/src/mongo/db/update/update_util.cpp b/src/mongo/db/update/update_util.cpp index 90f41da7dd1..80254801185 100644 --- a/src/mongo/db/update/update_util.cpp +++ b/src/mongo/db/update/update_util.cpp @@ -165,9 +165,7 @@ void makeUpdateRequest(OperationContext* opCtx, requestOut->setMulti(false); requestOut->setExplain(explain); - requestOut->setYieldPolicy(opCtx->inMultiDocumentTransaction() - ? PlanYieldPolicy::YieldPolicy::INTERRUPT_ONLY - : PlanYieldPolicy::YieldPolicy::YIELD_AUTO); + requestOut->setYieldPolicy(PlanYieldPolicy::YieldPolicy::YIELD_AUTO); } } // namespace update -- cgit v1.2.1