summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/run_on_all_shards_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/run_on_all_shards_cmd.cpp')
-rw-r--r--src/mongo/s/commands/run_on_all_shards_cmd.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/s/commands/run_on_all_shards_cmd.cpp b/src/mongo/s/commands/run_on_all_shards_cmd.cpp
index 9b0b26cf14b..b534bf0628a 100644
--- a/src/mongo/s/commands/run_on_all_shards_cmd.cpp
+++ b/src/mongo/s/commands/run_on_all_shards_cmd.cpp
@@ -64,14 +64,14 @@ BSONObj RunOnAllShardsCommand::specialErrorHandler(const std::string& server,
return originalResult;
}
-void RunOnAllShardsCommand::getShardIds(OperationContext* txn,
+void RunOnAllShardsCommand::getShardIds(OperationContext* opCtx,
const std::string& db,
BSONObj& cmdObj,
std::vector<ShardId>& shardIds) {
grid.shardRegistry()->getAllShardIds(&shardIds);
}
-bool RunOnAllShardsCommand::run(OperationContext* txn,
+bool RunOnAllShardsCommand::run(OperationContext* opCtx,
const std::string& dbName,
BSONObj& cmdObj,
int options,
@@ -80,15 +80,15 @@ bool RunOnAllShardsCommand::run(OperationContext* txn,
LOG(1) << "RunOnAllShardsCommand db: " << dbName << " cmd:" << redact(cmdObj);
if (_implicitCreateDb) {
- uassertStatusOK(ScopedShardDatabase::getOrCreate(txn, dbName));
+ uassertStatusOK(ScopedShardDatabase::getOrCreate(opCtx, dbName));
}
std::vector<ShardId> shardIds;
- getShardIds(txn, dbName, cmdObj, shardIds);
+ getShardIds(opCtx, dbName, cmdObj, shardIds);
std::list<std::shared_ptr<Future::CommandResult>> futures;
for (const ShardId& shardId : shardIds) {
- const auto shardStatus = grid.shardRegistry()->getShard(txn, shardId);
+ const auto shardStatus = grid.shardRegistry()->getShard(opCtx, shardId);
if (!shardStatus.isOK()) {
continue;
}
@@ -120,7 +120,7 @@ bool RunOnAllShardsCommand::run(OperationContext* txn,
++futuresit, ++shardIdsIt) {
std::shared_ptr<Future::CommandResult> res = *futuresit;
- if (res->join(txn)) {
+ if (res->join(opCtx)) {
// success :)
BSONObj result = res->result();
results.emplace_back(shardIdsIt->toString(), result);