diff --git a/fdbserver/DataDistribution.actor.cpp b/fdbserver/DataDistribution.actor.cpp index bfdf3264af..d410436d76 100644 --- a/fdbserver/DataDistribution.actor.cpp +++ b/fdbserver/DataDistribution.actor.cpp @@ -4826,6 +4826,21 @@ ACTOR Future ddSnapCreateCore(DistributorSnapRequest snapReq, Reference ddGetMetrics(GetDataDistributorMetricsRequest req, PromiseStream getShardMetricsList) { + ErrorOr>> result = wait(errorOr(brokenPromiseToNever( + getShardMetricsList.getReply(GetMetricsListRequest(req.keys, req.shardLimit))))); + + if(result.isError()) { + req.reply.sendError(result.getError()); + } else { + GetDataDistributorMetricsReply rep; + rep.storageMetricsList = result.get(); + req.reply.send(rep); + } + + return Void(); +} + ACTOR Future ddSnapCreate(DistributorSnapRequest snapReq, Reference> db ) { state Future dbInfoChange = db->onChange(); if (!setDDEnabled(false, snapReq.snapUID)) { @@ -5010,21 +5025,12 @@ ACTOR Future dataDistributor(DataDistributorInterface di, Reference>> result = wait(errorOr(brokenPromiseToNever( - getShardMetricsList.getReply(GetMetricsListRequest(req.keys, req.shardLimit))))); + getShardMetricsList.getReply(GetMetricsListRequest(req.keys, req.shardLimit))))); if ( result.isError() ) { req.reply.sendError(result.getError()); } else { GetDataDistributorMetricsReply rep; - if(!req.midOnly) { - rep.storageMetricsList = result.get(); - } - else { - auto& metricVec = result.get(); - if(metricVec.empty()) rep.midShardSize = 0; - else { - rep.midShardSize = getMedianShardSize(metricVec.contents()); - } - } + rep.storageMetricsList = result.get(); req.reply.send(rep); } }