summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/fetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/fetch.cpp')
-rw-r--r--src/mongo/db/exec/fetch.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp
index fb76a5f9f81..c22a30b5c7e 100644
--- a/src/mongo/db/exec/fetch.cpp
+++ b/src/mongo/db/exec/fetch.cpp
@@ -128,6 +128,9 @@ PlanStage::StageState FetchStage::work(WorkingSetID* out) {
return NEED_TIME;
}
} catch (const WriteConflictException& wce) {
+ // Ensure that the BSONObj underlying the WorkingSetMember is owned because it may
+ // be freed when we yield.
+ member->makeObjOwned();
_idRetrying = id;
*out = WorkingSet::INVALID_ID;
_commonStats.needYield++;