summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/cleanup_orphaned_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/cleanup_orphaned_cmd.cpp')
-rw-r--r--src/mongo/db/s/cleanup_orphaned_cmd.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp
index 038ecbfbdeb..d6690f872ef 100644
--- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp
+++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp
@@ -72,7 +72,7 @@ enum CleanupResult { CleanupResult_Done, CleanupResult_Continue, CleanupResult_E
*
* If the collection is not sharded, returns CleanupResult_Done.
*/
-CleanupResult cleanupOrphanedData(OperationContext* txn,
+CleanupResult cleanupOrphanedData(OperationContext* opCtx,
const NamespaceString& ns,
const BSONObj& startingFromKeyConst,
const WriteConcernOptions& secondaryThrottle,
@@ -82,8 +82,8 @@ CleanupResult cleanupOrphanedData(OperationContext* txn,
ScopedCollectionMetadata metadata;
{
- AutoGetCollection autoColl(txn, ns, MODE_IS);
- metadata = CollectionShardingState::get(txn, ns.toString())->getMetadata();
+ AutoGetCollection autoColl(opCtx, ns, MODE_IS);
+ metadata = CollectionShardingState::get(opCtx, ns.toString())->getMetadata();
}
if (!metadata || metadata->getKeyPattern().isEmpty()) {
@@ -132,7 +132,7 @@ CleanupResult cleanupOrphanedData(OperationContext* txn,
deleterOptions.waitForOpenCursors = true;
deleterOptions.removeSaverReason = "cleanup-cmd";
- if (!getDeleter()->deleteNow(txn, deleterOptions, errMsg)) {
+ if (!getDeleter()->deleteNow(opCtx, deleterOptions, errMsg)) {
warning() << redact(*errMsg);
return CleanupResult_Error;
}
@@ -203,7 +203,7 @@ public:
// Output
static BSONField<BSONObj> stoppedAtKeyField;
- bool run(OperationContext* txn,
+ bool run(OperationContext* opCtx,
string const& db,
BSONObj& cmdObj,
int,
@@ -227,9 +227,9 @@ public:
const auto secondaryThrottle =
uassertStatusOK(MigrationSecondaryThrottleOptions::createFromCommand(cmdObj));
const auto writeConcern = uassertStatusOK(
- ChunkMoveWriteConcernOptions::getEffectiveWriteConcern(txn, secondaryThrottle));
+ ChunkMoveWriteConcernOptions::getEffectiveWriteConcern(opCtx, secondaryThrottle));
- ShardingState* const shardingState = ShardingState::get(txn);
+ ShardingState* const shardingState = ShardingState::get(opCtx);
if (!shardingState->enabled()) {
errmsg = str::stream() << "server is not part of a sharded cluster or "
@@ -238,7 +238,7 @@ public:
}
ChunkVersion shardVersion;
- Status status = shardingState->refreshMetadataNow(txn, nss, &shardVersion);
+ Status status = shardingState->refreshMetadataNow(opCtx, nss, &shardVersion);
if (!status.isOK()) {
if (status.code() == ErrorCodes::RemoteChangeDetected) {
warning() << "Shard version in transition detected while refreshing "
@@ -251,7 +251,7 @@ public:
BSONObj stoppedAtKey;
CleanupResult cleanupResult =
- cleanupOrphanedData(txn, nss, startingFromKey, writeConcern, &stoppedAtKey, &errmsg);
+ cleanupOrphanedData(opCtx, nss, startingFromKey, writeConcern, &stoppedAtKey, &errmsg);
if (cleanupResult == CleanupResult_Error) {
return false;