From cd18f84304124e1341516194fb73c8bde48db445 Mon Sep 17 00:00:00 2001 From: Theofilos Mouratidis Date: Mon, 25 Sep 2017 16:17:47 +0200 Subject: [PATCH] osd: upmap should respect osd reweights Modify OSDMap::calc_pg_upmaps to take the osd reweight into account when computing the size of each OSD. Signed-off-by: Theofilos Mouratidis Fixes: http://tracker.ceph.com/issues/21538 (cherry picked from commit b8561cefa705d31954d47723125376a3c087f4f4) --- src/osd/OSDMap.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 8c6eb46a9c097..3143bbccf0cc9 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -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) { -- 2.39.5