summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-09-28 15:33:05 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-09-29 13:28:48 -0400
commitb12af9e243b98b50d5918d9afa9354b9935cebf0 (patch)
tree0c866ad5bc76d5901799a9adac9fc14bd71c9955 /src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
parentb4d55086ed9a5d49709409c9c66652f12fa3d932 (diff)
downloadmongo-b12af9e243b98b50d5918d9afa9354b9935cebf0.tar.gz
SERVER-26370 Cleanup MigrationDestinationManager
Diffstat (limited to 'src/mongo/db/s/migration_destination_manager_legacy_commands.cpp')
-rw-r--r--src/mongo/db/s/migration_destination_manager_legacy_commands.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
index 86df3fe2edb..4216b30ef5e 100644
--- a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
+++ b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp
@@ -124,7 +124,7 @@ public:
shardingState->setShardName(toShard.toString());
const ShardId fromShard(cmdObj["fromShardName"].String());
- const string ns = cmdObj.firstElement().String();
+ const NamespaceString nss(cmdObj.firstElement().String());
BSONObj min = cmdObj["min"].Obj().getOwned();
BSONObj max = cmdObj["max"].Obj().getOwned();
@@ -134,7 +134,7 @@ public:
// consistent and predictable, generally we'd refresh anyway, and to be paranoid.
ChunkVersion currentVersion;
- Status status = shardingState->refreshMetadataNow(txn, ns, &currentVersion);
+ Status status = shardingState->refreshMetadataNow(txn, nss, &currentVersion);
if (!status.isOK()) {
errmsg = str::stream() << "cannot start recv'ing chunk "
<< "[" << redact(min) << "," << redact(max) << ")"
@@ -166,8 +166,8 @@ public:
const MigrationSessionId migrationSessionId(
uassertStatusOK(MigrationSessionId::extractFromBSON(cmdObj)));
- Status startStatus = shardingState->migrationDestinationManager()->start(
- ns,
+ uassertStatusOK(shardingState->migrationDestinationManager()->start(
+ nss,
migrationSessionId,
statusWithFromShardConnectionString.getValue(),
fromShard,
@@ -176,10 +176,7 @@ public:
max,
shardKeyPattern,
currentVersion.epoch(),
- writeConcern);
- if (!startStatus.isOK()) {
- return appendCommandStatus(result, startStatus);
- }
+ writeConcern));
result.appendBool("started", true);
return true;