diff options
Diffstat (limited to 'src/mongo/db/range_deleter.cpp')
-rw-r--r-- | src/mongo/db/range_deleter.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp index dc6e48e038d..e3a737600d7 100644 --- a/src/mongo/db/range_deleter.cpp +++ b/src/mongo/db/range_deleter.cpp @@ -201,7 +201,7 @@ void RangeDeleter::stopWorkers() { } } -bool RangeDeleter::queueDelete(OperationContext* txn, +bool RangeDeleter::queueDelete(OperationContext* opCtx, const RangeDeleterOptions& options, Notification<void>* doneSignal, std::string* errMsg) { @@ -231,7 +231,7 @@ bool RangeDeleter::queueDelete(OperationContext* txn, } if (options.waitForOpenCursors) { - _env->getCursorIds(txn, ns, &toDelete->cursorsToWait); + _env->getCursorIds(opCtx, ns, &toDelete->cursorsToWait); } toDelete->stats.queueStartTS = jsTime(); @@ -257,12 +257,12 @@ bool RangeDeleter::queueDelete(OperationContext* txn, namespace { const int kWTimeoutMillis = 60 * 60 * 1000; -bool _waitForMajority(OperationContext* txn, std::string* errMsg) { +bool _waitForMajority(OperationContext* opCtx, std::string* errMsg) { const WriteConcernOptions writeConcern( WriteConcernOptions::kMajority, WriteConcernOptions::SyncMode::UNSET, kWTimeoutMillis); repl::ReplicationCoordinator::StatusAndDuration replStatus = - repl::getGlobalReplicationCoordinator()->awaitReplicationOfLastOpForClient(txn, + repl::getGlobalReplicationCoordinator()->awaitReplicationOfLastOpForClient(opCtx, writeConcern); if (!replStatus.status.isOK()) { *errMsg = str::stream() << "rangeDeleter failed while waiting for replication after " @@ -275,7 +275,7 @@ bool _waitForMajority(OperationContext* txn, std::string* errMsg) { } } // namespace -bool RangeDeleter::deleteNow(OperationContext* txn, +bool RangeDeleter::deleteNow(OperationContext* opCtx, const RangeDeleterOptions& options, string* errMsg) { if (stopRequested()) { @@ -308,7 +308,7 @@ bool RangeDeleter::deleteNow(OperationContext* txn, RangeDeleteEntry taskDetails(options); if (options.waitForOpenCursors) { - _env->getCursorIds(txn, ns, &taskDetails.cursorsToWait); + _env->getCursorIds(opCtx, ns, &taskDetails.cursorsToWait); } long long checkIntervalMillis = 5; @@ -320,7 +320,7 @@ bool RangeDeleter::deleteNow(OperationContext* txn, logCursorsWaiting(&taskDetails); set<CursorId> cursorsNow; - _env->getCursorIds(txn, ns, &cursorsNow); + _env->getCursorIds(opCtx, ns, &cursorsNow); set<CursorId> cursorsLeft; std::set_intersection(taskDetails.cursorsToWait.begin(), @@ -353,13 +353,13 @@ bool RangeDeleter::deleteNow(OperationContext* txn, taskDetails.stats.queueEndTS = jsTime(); taskDetails.stats.deleteStartTS = jsTime(); - bool result = _env->deleteRange(txn, taskDetails, &taskDetails.stats.deletedDocCount, errMsg); + bool result = _env->deleteRange(opCtx, taskDetails, &taskDetails.stats.deletedDocCount, errMsg); taskDetails.stats.deleteEndTS = jsTime(); if (result) { taskDetails.stats.waitForReplStartTS = jsTime(); - result = _waitForMajority(txn, errMsg); + result = _waitForMajority(opCtx, errMsg); taskDetails.stats.waitForReplEndTS = jsTime(); } @@ -441,8 +441,8 @@ void RangeDeleter::doWork() { set<CursorId> cursorsNow; if (entry->options.waitForOpenCursors) { - auto txn = client->makeOperationContext(); - _env->getCursorIds(txn.get(), entry->options.range.ns, &cursorsNow); + auto opCtx = client->makeOperationContext(); + _env->getCursorIds(opCtx.get(), entry->options.range.ns, &cursorsNow); } set<CursorId> cursorsLeft; @@ -479,16 +479,16 @@ void RangeDeleter::doWork() { } { - auto txn = client->makeOperationContext(); + auto opCtx = client->makeOperationContext(); nextTask->stats.deleteStartTS = jsTime(); - bool delResult = - _env->deleteRange(txn.get(), *nextTask, &nextTask->stats.deletedDocCount, &errMsg); + bool delResult = _env->deleteRange( + opCtx.get(), *nextTask, &nextTask->stats.deletedDocCount, &errMsg); nextTask->stats.deleteEndTS = jsTime(); if (delResult) { nextTask->stats.waitForReplStartTS = jsTime(); - if (!_waitForMajority(txn.get(), &errMsg)) { + if (!_waitForMajority(opCtx.get(), &errMsg)) { warning() << "Error encountered while waiting for replication: " << errMsg; } |