From: Sage Weil Date: Tue, 2 Dec 2014 18:08:18 +0000 (-0800) Subject: crush: recalculate straw scalers during a reweight X-Git-Tag: v0.80.9~11^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9faab9f296af9cf26b9475afd3562c3f3b9236b;p=ceph.git crush: recalculate straw scalers during a reweight The crushtool --reweight function triggers a fresh calculation of bucket weights so that they are always the sum of the item weights. In the straw bucket case, the weights were updated but the corresponding straw scalers were not being recalculated. The result is that there was not effect on placement in adjusted buckets until the next time a bucket item's weight was adjusted. Backport: giant, firefly Signed-off-by: Sage Weil (cherry picked from commit 35062937f174a45fb13d9c177eaa1fe4ed5ff4c2) --- diff --git a/src/crush/builder.c b/src/crush/builder.c index 86f9af9e26c..6bdd2cfe698 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -1183,6 +1183,7 @@ static int crush_reweight_straw_bucket(struct crush_map *crush, struct crush_buc bucket->h.weight += bucket->item_weights[i]; } + crush_calc_straw(bucket); return 0; }