]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: recalculate straw scalers during a reweight
authorSage Weil <sage@redhat.com>
Tue, 2 Dec 2014 18:08:18 +0000 (10:08 -0800)
committerSage Weil <sage@redhat.com>
Sat, 7 Feb 2015 20:33:23 +0000 (12:33 -0800)
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 <sage@redhat.com>
(cherry picked from commit 35062937f174a45fb13d9c177eaa1fe4ed5ff4c2)

src/crush/builder.c

index 86f9af9e26cbd4e9143ec37b00ac533289ad5e1a..6bdd2cfe6984dac5e3e1c23b18219d336ab31b58 100644 (file)
@@ -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;
 }