From 4d52e41bafe5181e91085b150f55c860b41b2e83 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 14 Jul 2017 15:37:12 -0400 Subject: [PATCH] crush/CrushWrapper: remove_item_under: weight down weight-sets Signed-off-by: Sage Weil --- src/crush/CrushWrapper.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 66bffe0b01235..2a7b7832b7dc5 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -518,6 +518,12 @@ int CrushWrapper::_remove_item_under( ldout(cct, 5) << "_remove_item_under removing item " << item << " from bucket " << b->id << dendl; bucket_remove_item(b, item); + 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_in_bucket( + cct, p.second, b->id, item, weightv, nullptr); + } adjust_item_weight(cct, b->id, b->weight); ret = 0; } else if (id < 0) { -- 2.39.5