summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2016-08-24 18:05:09 -0400
committerMisha Tyulenev <misha@mongodb.com>2016-08-25 11:57:21 -0400
commit46b33e042de75d801e5fd9f20b74a1c9a249b0c2 (patch)
treeb339c718ee0282cfd04190725369a3b9f154d111 /src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
parente589562b858061cf82dd430115c82033203db018 (diff)
downloadmongo-46b33e042de75d801e5fd9f20b74a1c9a249b0c2.tar.gz
SERVER-23996 ShardRegistry::getShard should return a StatusWith<shared_ptr<Shard>>
Diffstat (limited to 'src/mongo/s/commands/cluster_merge_chunks_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_merge_chunks_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
index d534c29aadd..44f8e74ccf2 100644
--- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
+++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
@@ -185,15 +185,15 @@ public:
// Throws, but handled at level above. Don't want to rewrap to preserve exception
// formatting.
- const auto shard = grid.shardRegistry()->getShard(txn, firstChunk->getShardId());
- if (!shard) {
+ const auto shardStatus = grid.shardRegistry()->getShard(txn, firstChunk->getShardId());
+ if (!shardStatus.isOK()) {
return appendCommandStatus(
result,
Status(ErrorCodes::ShardNotFound,
str::stream() << "Can't find shard for chunk: " << firstChunk->toString()));
}
- ShardConnection conn(shard->getConnString(), "");
+ ShardConnection conn(shardStatus.getValue()->getConnString(), "");
bool ok = conn->runCommand("admin", remoteCmdObjB.obj(), remoteResult);
conn.done();