diff options
Diffstat (limited to 'src/mongo/s/commands/cluster_add_shard_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_add_shard_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/s/commands/cluster_add_shard_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_cmd.cpp index e2cb0e4f117..c54804992d2 100644 --- a/src/mongo/s/commands/cluster_add_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_cmd.cpp @@ -80,7 +80,7 @@ public: out->push_back(Privilege(ResourcePattern::forClusterResource(), actions)); } - virtual bool run(OperationContext* txn, + virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, int options, @@ -88,9 +88,9 @@ public: BSONObjBuilder& result) { auto parsedRequest = uassertStatusOK(AddShardRequest::parseFromMongosCommand(cmdObj)); - auto configShard = Grid::get(txn)->shardRegistry()->getConfigShard(); + auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard(); auto cmdResponseStatus = uassertStatusOK( - configShard->runCommandWithFixedRetryAttempts(txn, + configShard->runCommandWithFixedRetryAttempts(opCtx, kPrimaryOnlyReadPreference, "admin", parsedRequest.toCommandForConfig(), @@ -103,8 +103,8 @@ public: result << "shardAdded" << shardAdded; // Ensure the added shard is visible to this process. - auto shardRegistry = Grid::get(txn)->shardRegistry(); - if (!shardRegistry->getShard(txn, shardAdded).isOK()) { + auto shardRegistry = Grid::get(opCtx)->shardRegistry(); + if (!shardRegistry->getShard(opCtx, shardAdded).isOK()) { return appendCommandStatus(result, {ErrorCodes::OperationFailed, "Could not find shard metadata for shard after adding it. " |