summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_db_stats_cmd.cpp
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-04-17 15:40:56 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-04-17 15:40:56 -0400
commit4185dafcbe40b7c8fa194ee0c36422293f58be7a (patch)
treee80e89a50c29deef2aa9effa67db27ee48e9d1ca /src/mongo/s/commands/cluster_db_stats_cmd.cpp
parent92eaa6337842a52623e5489058e8417e857615cc (diff)
downloadmongo-4185dafcbe40b7c8fa194ee0c36422293f58be7a.tar.gz
SERVER-28792 make dropIndexes unversioned again
Diffstat (limited to 'src/mongo/s/commands/cluster_db_stats_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_db_stats_cmd.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/mongo/s/commands/cluster_db_stats_cmd.cpp b/src/mongo/s/commands/cluster_db_stats_cmd.cpp
index 1dc1e87392e..8bddb22148b 100644
--- a/src/mongo/s/commands/cluster_db_stats_cmd.cpp
+++ b/src/mongo/s/commands/cluster_db_stats_cmd.cpp
@@ -68,22 +68,11 @@ public:
BSONObj& cmdObj,
std::string& errmsg,
BSONObjBuilder& output) override {
- auto requests = buildRequestsForAllShards(opCtx, cmdObj);
- auto swResponses =
- gatherResponsesFromShards(opCtx, dbName, cmdObj, requests, &output, nullptr);
- if (!swResponses.isOK()) {
- // We failed to obtain a response or error from all shards.
- return appendCommandStatus(output, swResponses.getStatus());
- }
-
- // Only aggregate results if we got a success response from every shard.
- auto responses = std::move(swResponses.getValue());
- if (std::all_of(
- responses.begin(), responses.end(), [](AsyncRequestsSender::Response response) {
- return response.swResponse.getStatus().isOK();
- })) {
- aggregateResults(std::move(responses), output);
+ auto shardResponses = uassertStatusOK(scatterGather(opCtx, dbName, cmdObj));
+ if (!appendRawResponses(opCtx, &errmsg, &output, shardResponses)) {
+ return false;
}
+ aggregateResults(shardResponses, output);
return true;
}