Skip to content

Commit

Permalink
osd: upmap should respect osd reweights
Browse files Browse the repository at this point in the history
Modify OSDMap::calc_pg_upmaps to take the osd reweight into account when
computing the size of each OSD.

Signed-off-by: Theofilos Mouratidis <t.mour@cern.ch>
Fixes: http://tracker.ceph.com/issues/21538
  • Loading branch information
Theofilos Mouratidis committed Sep 25, 2017
1 parent ff9e024 commit b8561ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/osd/OSDMap.cc
Expand Up @@ -3835,8 +3835,9 @@ int OSDMap::calc_pg_upmaps(
tmp.crush->get_rule_weight_osd_map(ruleno, &pmap);
ldout(cct,30) << __func__ << " pool " << i.first << " ruleno " << ruleno << dendl;
for (auto p : pmap) {
osd_weight[p.first] += p.second;
osd_weight_total += p.second;
auto adjusted_weight = tmp.get_weightf(p.first) * p.second;
osd_weight[p.first] += adjusted_weight;
osd_weight_total += adjusted_weight;
}
}
for (auto& i : osd_weight) {
Expand Down

0 comments on commit b8561ce

Please sign in to comment.