From: Sage Weil Date: Fri, 14 Jul 2017 19:29:20 +0000 (-0400) Subject: crush/CrushWrapper: remove_item: weight down weight-sets X-Git-Tag: v12.1.2~150^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75a3566decb9e0492d048e7a1dbc2f2b5e00f86f;p=ceph.git crush/CrushWrapper: remove_item: weight down weight-sets Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 980df214a55..c3e1c50e364 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -438,6 +438,11 @@ int CrushWrapper::remove_item(CephContext *cct, int item, bool unlink_only) if (id == item) { ldout(cct, 5) << "remove_item removing item " << item << " from bucket " << b->id << dendl; + 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); + } bucket_remove_item(b, item); adjust_item_weight(cct, b->id, b->weight); ret = 0;