summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-10-11 14:54:25 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-10-12 12:14:44 -0400
commitc25497890b202d12b35eb153fd740af0caefa5b2 (patch)
tree70054426f8b03fd054d5daf7c21d4f311e95ff4c /src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
parentb5cea947a24609d098d4e5d691a1b7a9a8debb1d (diff)
downloadmongo-c25497890b202d12b35eb153fd740af0caefa5b2.tar.gz
SERVER-31520 metadata commands on mongos should transparently pass config server response back to client
Diffstat (limited to 'src/mongo/s/commands/cluster_enable_sharding_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_enable_sharding_cmd.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
index d33823630dc..80067cbeea3 100644
--- a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
+++ b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp
@@ -99,19 +99,14 @@ public:
ON_BLOCK_EXIT([opCtx, db] { Grid::get(opCtx)->catalogCache()->purgeDatabase(db); });
auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard();
- auto cmdResponseStatus = uassertStatusOK(configShard->runCommandWithFixedRetryAttempts(
+ auto cmdResponse = uassertStatusOK(configShard->runCommandWithFixedRetryAttempts(
opCtx,
ReadPreferenceSetting(ReadPreference::PrimaryOnly),
"admin",
Command::appendPassthroughFields(cmdObj, BSON("_configsvrEnableSharding" << db)),
Shard::RetryPolicy::kIdempotent));
- uassertStatusOK(cmdResponseStatus.commandStatus);
-
- if (!cmdResponseStatus.writeConcernStatus.isOK()) {
- appendWriteConcernErrorToCmdResponse(
- configShard->getId(), cmdResponseStatus.response["writeConcernError"], result);
- }
+ Command::filterCommandReplyForPassthrough(cmdResponse.response, &result);
return true;
}