From: Sage Weil Date: Fri, 14 Jul 2017 19:33:55 +0000 (-0400) Subject: crush/CrushWrapper: detach_bucket: weight down weight_sets X-Git-Tag: v12.1.2~150^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cdcfab35dc2fea654232701b159e378bb6e7dd3a;p=ceph.git crush/CrushWrapper: detach_bucket: weight down weight_sets Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index b8cfc449aaed..3d2ae916ea9f 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -999,6 +999,11 @@ int CrushWrapper::detach_bucket(CephContext *cct, int item) // zero out the bucket weight bucket_adjust_item_weight(cct, parent_bucket, item, 0); adjust_item_weight(cct, parent_bucket->id, parent_bucket->weight); + for (auto& p : choose_args) { + // weight down each weight-set to 0 before we remove the item + vector weightv(get_choose_args_positions(p.second), 0); + choose_args_adjust_item_weight(cct, p.second, item, weightv, nullptr); + } // remove the bucket from the parent bucket_remove_item(parent_bucket, item);