From 75a3566decb9e0492d048e7a1dbc2f2b5e00f86f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 14 Jul 2017 15:29:20 -0400 Subject: [PATCH] crush/CrushWrapper: remove_item: weight down weight-sets Signed-off-by: Sage Weil --- src/crush/CrushWrapper.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 980df214a555a..c3e1c50e36422 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; -- 2.39.5