summaryrefslogtreecommitdiff
path: root/src/mongo/db/range_deleter.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-05-29 18:13:48 -0400
committerSpencer T Brody <spencer@mongodb.com>2015-05-29 18:13:48 -0400
commite181ea38af737ef7aaf5f8228f870d8c7149b2bb (patch)
tree5c340753a9315e29b0c4b738c262eee7f538df64 /src/mongo/db/range_deleter.cpp
parentc6a542c1e69e0027c7a10f865cfa7767d5ed089d (diff)
downloadmongo-e181ea38af737ef7aaf5f8228f870d8c7149b2bb.tar.gz
Revert "SERVER-14995 Move operation id, lockState and client fields to OperationContext."
This reverts commit 4ea38c308da292f43e29d32b1b53b7324db0bafe.
Diffstat (limited to 'src/mongo/db/range_deleter.cpp')
-rw-r--r--src/mongo/db/range_deleter.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp
index cb00ad28554..caa2c63804c 100644
--- a/src/mongo/db/range_deleter.cpp
+++ b/src/mongo/db/range_deleter.cpp
@@ -448,6 +448,8 @@ namespace {
while (!inShutdown() && !stopRequested()) {
string errMsg;
+ boost::scoped_ptr<OperationContext> txn(getGlobalServiceContext()->newOpCtx());
+
RangeDeleteEntry* nextTask = NULL;
{
@@ -470,11 +472,12 @@ namespace {
RangeDeleteEntry* entry = *iter;
set<CursorId> cursorsNow;
- if (entry->options.waitForOpenCursors) {
- auto txn = getGlobalServiceContext()->newOpCtx();
- _env->getCursorIds(txn.get(),
- entry->options.range.ns,
- &cursorsNow);
+ {
+ if (entry->options.waitForOpenCursors) {
+ _env->getCursorIds(txn.get(),
+ entry->options.range.ns,
+ &cursorsNow);
+ }
}
set<CursorId> cursorsLeft;
@@ -513,7 +516,6 @@ namespace {
}
{
- auto txn = getGlobalServiceContext()->newOpCtx();
nextTask->stats.deleteStartTS = jsTime();
bool delResult = _env->deleteRange(txn.get(),
*nextTask,