]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crush/CrushWrapper: detach_bucket: weight down weight_sets
authorSage Weil <sage@redhat.com>
Fri, 14 Jul 2017 19:33:55 +0000 (15:33 -0400)
committerSage Weil <sage@redhat.com>
Fri, 21 Jul 2017 17:50:54 +0000 (13:50 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/crush/CrushWrapper.cc

index b8cfc449aaed5631fc3f58763c57a298ccbb0644..3d2ae916ea9f7cff21f6bf3a0532b41d2c9a086d 100644 (file)
@@ -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<int> 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);