]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: upmap should respect osd reweights 17944/head
authorTheofilos Mouratidis <t.mour@cern.ch>
Mon, 25 Sep 2017 14:17:47 +0000 (16:17 +0200)
committerTheofilos Mouratidis <t.mour@cern.ch>
Mon, 25 Sep 2017 17:56:28 +0000 (19:56 +0200)
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
src/osd/OSDMap.cc

index 395ca3723173fd63f4b2f5bf67ac66bfaccaab39..c9db12c0f03027c46ed29459008702f3e067f8ce 100644 (file)
@@ -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) {