]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: upmap should respect osd reweights 18699/head
authorTheofilos Mouratidis <t.mour@cern.ch>
Mon, 25 Sep 2017 14:17:47 +0000 (16:17 +0200)
committerShinobu Kinjo <shinobu@redhat.com>
Fri, 3 Nov 2017 07:34:48 +0000 (16:34 +0900)
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
(cherry picked from commit b8561cefa705d31954d47723125376a3c087f4f4)

src/osd/OSDMap.cc

index 8c6eb46a9c0972a13961754a77a3267ee93df26b..3143bbccf0cc9a67dbe89a6756dbb07241c114d5 100644 (file)
@@ -3871,8 +3871,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) {