summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/catalog/index_builds_manager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/index_builds_manager.cpp b/src/mongo/db/catalog/index_builds_manager.cpp
index 87c3b384a9d..b6f35ceb1b6 100644
--- a/src/mongo/db/catalog/index_builds_manager.cpp
+++ b/src/mongo/db/catalog/index_builds_manager.cpp
@@ -179,6 +179,11 @@ StatusWith<std::pair<long long, long long>> IndexBuildsManager::startBuildingInd
}
record = cursor->next();
}
+
+ // Time to yield; make a safe copy of the current record before releasing our cursor.
+ if (record)
+ record->data.makeOwned();
+
cursor->save(); // Can't fail per API definition
// When this exits via success or WCE, we need to restore the cursor
ON_BLOCK_EXIT([opCtx, ns, &cursor]() {