summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-08-03 13:44:17 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-08-03 13:44:17 -0400
commitce41c7bb609db8f33c6b3a04547325d01605cbc8 (patch)
tree64805de5779780303d2d625d17eabe45e5dbcfc0
parentcf38c1b8a0a8dca4a11737581beafef4fe120bcd (diff)
downloadmongo-ce41c7bb609db8f33c6b3a04547325d01605cbc8.tar.gz
SERVER-30487 Make sharding range deleter yield the WT snapshot after each iteration
-rw-r--r--src/mongo/db/dbhelpers.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index ebed6807c7e..fbf979277e2 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -283,6 +283,7 @@ long long Helpers::removeRange(OperationContext* txn,
BSONObj max;
{
+ ScopedTransaction scopedXact(txn, MODE_IS);
AutoGetCollectionForRead ctx(txn, ns);
Collection* collection = ctx.getCollection();
if (!collection) {
@@ -331,6 +332,7 @@ long long Helpers::removeRange(OperationContext* txn,
while (1) {
// Scoping for write lock.
{
+ ScopedTransaction scopedXact(txn, MODE_IX);
AutoGetCollection ctx(txn, NamespaceString(ns), MODE_IX, MODE_IX);
Collection* collection = ctx.getCollection();
if (!collection)