]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: eliminate min_size and max_size
authorSage Weil <sage@newdream.net>
Sat, 26 Jun 2021 19:11:32 +0000 (15:11 -0400)
committerSage Weil <sage@newdream.net>
Mon, 28 Jun 2021 22:34:31 +0000 (18:34 -0400)
We don't use min/max_size for anything any more.  Switch to encoding it
universally as 1 and 100, and ignoring when we decode.  We keep it around
for backward compat when (re)encoding without the SERVER_QUINCY feature.

Drop the crush_rule_mask struct since the only variable piece now is the
type.

Signed-off-by: Sage Weil <sage@newdream.net>
47 files changed:
doc/rados/operations/crush-map-edits.rst
doc/rados/troubleshooting/troubleshooting-pg.rst
src/crush/CrushCompiler.cc
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h
src/crush/builder.c
src/crush/builder.h
src/crush/crush.h
src/crush/grammar.h
src/erasure-code/ErasureCode.cc
src/erasure-code/lrc/ErasureCodeLrc.cc
src/test/cli/crushtool/add-bucket.t
src/test/cli/crushtool/add-item-in-tree.t
src/test/cli/crushtool/add-item.t
src/test/cli/crushtool/adjust-item-weight.t
src/test/cli/crushtool/arg-order-checks.t
src/test/cli/crushtool/bad-mappings.crushmap.txt
src/test/cli/crushtool/build.t
src/test/cli/crushtool/check-overlapped-rules.crushmap.txt
src/test/cli/crushtool/choose-args.crush
src/test/cli/crushtool/choose-args.t
src/test/cli/crushtool/compile-decompile-recompile.t
src/test/cli/crushtool/device-class.crush
src/test/cli/crushtool/empty-default.t
src/test/cli/crushtool/multitype.after
src/test/cli/crushtool/multitype.before
src/test/cli/crushtool/need_tree_order.crush
src/test/cli/crushtool/rules.t
src/test/cli/crushtool/set-choose.crushmap.txt
src/test/cli/crushtool/show-choose-tries.txt
src/test/cli/crushtool/simple.template.adj.one
src/test/cli/crushtool/simple.template.adj.three
src/test/cli/crushtool/simple.template.adj.two
src/test/cli/crushtool/simple.template.five
src/test/cli/crushtool/simple.template.four
src/test/cli/crushtool/simple.template.multitree
src/test/cli/crushtool/simple.template.multitree.reweighted
src/test/cli/crushtool/simple.template.one
src/test/cli/crushtool/simple.template.two
src/test/cli/crushtool/straw2.txt
src/test/cli/crushtool/test-map-firstn-indep.txt
src/test/cli/crushtool/tree.template.final
src/test/cli/osdmaptool/create-print.t
src/test/cli/osdmaptool/create-racks.t
src/test/crush/CrushWrapper.cc
src/test/crush/crush.cc
src/test/osd/TestOSDMap.cc

index cb8771ac2c75ab9d94efc6f4b9a31ba350703e32..eaed1c709026e8a7918d9bb14803e053b0cd1c9b 100644 (file)
@@ -555,8 +555,6 @@ There are three types of transformations possible:
      rule replicated_rule {
         id 0
         type replicated
-        min_size 1
-        max_size 10
         step take default
         step chooseleaf firstn 0 type rack
         step emit
@@ -568,8 +566,6 @@ There are three types of transformations possible:
      rule replicated_rule {
         id 0
         type replicated
-        min_size 1
-        max_size 10
         step take default class hdd
         step chooseleaf firstn 0 type rack
         step emit
index 15b0c6894c4151711b9d616bcd836ac983d85b11..04310d322a970291c3f3e610478c9923dcbd243e 100644 (file)
@@ -523,8 +523,6 @@ the rule::
     { "rule_id": 1,
       "rule_name": "erasurepool",
       "type": 3,
-      "min_size": 3,
-      "max_size": 20,
       "steps": [
             { "op": "take",
               "item": -1,
@@ -568,8 +566,6 @@ modify the Ceph cluster and only work on a local files::
     { "rule_id": 1,
       "rule_name": "erasurepool",
       "type": 3,
-      "min_size": 3,
-      "max_size": 20,
       "steps": [
             { "op": "take",
               "item": -1,
@@ -610,8 +606,6 @@ like::
      rule erasurepool {
              id 1
              type erasure
-             min_size 3
-             max_size 20
              step set_chooseleaf_tries 5
              step set_choose_tries 100
              step take default
index bdffe435689acd39fcf408f2dd145cf94ac5d9c2..a936684f68eb95d111caea105adba12c5a93b54a 100644 (file)
@@ -373,9 +373,6 @@ int CrushCompiler::decompile(ostream &out)
       out << "\ttype " << crush.get_rule_type(i) << "\n";
     }
 
-    out << "\tmin_size " << crush.get_rule_mask_min_size(i) << "\n";
-    out << "\tmax_size " << crush.get_rule_mask_max_size(i) << "\n";
-
     for (int j=0; j<crush.get_rule_len(i); j++) {
       switch (crush.get_rule_op(i, j)) {
       case CRUSH_RULE_NOOP:
@@ -790,17 +787,29 @@ int CrushCompiler::parse_rule(iter_t const& i)
   else 
     ceph_abort();
 
-  int minsize = int_node(i->children[start+4]);
-  int maxsize = int_node(i->children[start+6]);
-  
-  int steps = i->children.size() - start - 8;
-  //err << "num steps " << steps << std::endl;
+  // ignore min_size+max_size and find first step
+  int step_start = 0;
+  int steps = 0;
+  for (unsigned p = start + 3; p < i->children.size()-1; ++p) {
+    string tag = string_node(i->children[p]);
+    if (tag == "min_size" || tag == "max_size") {
+      cerr << "WARNING: " << tag << " is no longer supported, ignoring" << std::endl;
+      ++p;
+      continue;
+    }
+    // has to be a step--grammer doesn't recognized anything else
+    assert(i->children[p].value.id().to_long() == crush_grammar::_step);
+    step_start = p;
+    steps = i->children.size() - p - 1;
+    break;
+  }
+  //err << "num steps " << steps << " start " << step_start << std::endl;
 
   if (crush.rule_exists(ruleno)) {
     err << "rule " << ruleno << " already exists" << std::endl;
     return -1;
   }
-  int r = crush.add_rule(ruleno, steps, type, minsize, maxsize);
+  int r = crush.add_rule(ruleno, steps, type);
   if (r != ruleno) {
     err << "unable to add rule id " << ruleno << " for rule '" << rname
        << "'" << std::endl;
@@ -812,7 +821,7 @@ int CrushCompiler::parse_rule(iter_t const& i)
   }
 
   int step = 0;
-  for (iter_t p = i->children.begin() + start + 7; step < steps; p++) {
+  for (iter_t p = i->children.begin() + step_start; step < steps; p++) {
     iter_t s = p->children.begin() + 1;
     int stepid = s->value.id().to_long();
     switch (stepid) {
index 5a36d42d9d073a40c28f516304978af0c75dc290..530c2413933d095b2a287f5d208507e3bcb9e3e8 100644 (file)
@@ -2302,9 +2302,7 @@ int CrushWrapper::add_simple_rule_at(
   int steps = 3;
   if (mode == "indep")
     steps = 5;
-  int min_rep = mode == "firstn" ? 1 : 3;
-  int max_rep = mode == "firstn" ? 10 : 20;
-  crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_rep, max_rep);
+  crush_rule *rule = crush_make_rule(steps, rule_type);
   ceph_assert(rule);
   int step = 0;
   if (mode == "indep") {
@@ -3000,7 +2998,29 @@ void CrushWrapper::encode(bufferlist& bl, uint64_t features) const
       continue;
 
     encode(crush->rules[i]->len, bl);
-    encode(crush->rules[i]->mask, bl);
+
+    /*
+     * legacy crush_rule_mask was
+     *
+     * struct crush_rule_mask {
+     *         __u8 ruleset;
+     *         __u8 type;
+     *         __u8 min_size;
+     *         __u8 max_size;
+     * };
+     *
+     * encode ruleset=ruleid, and min/max of 1/100
+     */
+    encode((__u8)i, bl);   // ruleset == ruleid
+    encode(crush->rules[i]->type, bl);
+    if (HAVE_FEATURE(features, SERVER_QUINCY)) {
+      encode((__u8)1, bl);   // min_size = 1
+      encode((__u8)100, bl); // max_size = 100
+    } else {
+      encode(crush->rules[i]->deprecated_min_size, bl);
+      encode(crush->rules[i]->deprecated_max_size, bl);
+    }
+
     for (unsigned j=0; j<crush->rules[i]->len; j++)
       encode(crush->rules[i]->steps[j], bl);
   }
@@ -3121,7 +3141,16 @@ void CrushWrapper::decode(bufferlist::const_iterator& blp)
       decode(len, blp);
       crush->rules[i] = reinterpret_cast<crush_rule*>(calloc(1, crush_rule_size(len)));
       crush->rules[i]->len = len;
-      decode(crush->rules[i]->mask, blp);
+
+      __u8 ruleset; // ignore + discard
+      decode(ruleset, blp);
+      if (ruleset != i) {
+       throw ::ceph::buffer::malformed_input("crush ruleset_id != rule_id; encoding is too old");
+      }
+      decode(crush->rules[i]->type, blp);
+      decode(crush->rules[i]->deprecated_min_size, blp);
+      decode(crush->rules[i]->deprecated_max_size, blp);
+      
       for (unsigned j=0; j<crush->rules[i]->len; j++)
        decode(crush->rules[i]->steps[j], blp);
     }
@@ -3546,8 +3575,6 @@ void CrushWrapper::dump_rule(int rule_id, Formatter *f) const
   if (get_rule_name(rule_id))
     f->dump_string("rule_name", get_rule_name(rule_id));
   f->dump_int("type", get_rule_type(rule_id));
-  f->dump_int("min_size", get_rule_mask_min_size(rule_id));
-  f->dump_int("max_size", get_rule_mask_max_size(rule_id));
   f->open_array_section("steps");
   for (int j=0; j<get_rule_len(rule_id); j++) {
     f->open_object_section("step");
index 567b654ce27856653ca27c94486e9f76994df792..413e0027cb7007045e7497102f956501646fb947 100644 (file)
@@ -33,8 +33,6 @@ namespace CrushTreeDumper {
 typedef mempool::osdmap::map<int64_t,std::string> name_map_t;
 }
 
-WRITE_RAW_ENCODER(crush_rule_mask)   // it's all u8's
-
 inline void encode(const crush_rule_step &s, ceph::buffer::list &bl)
 {
   using ceph::encode;
@@ -1065,17 +1063,7 @@ public:
   int get_rule_type(unsigned ruleno) const {
     crush_rule *r = get_rule(ruleno);
     if (IS_ERR(r)) return -1;
-    return r->mask.type;
-  }
-  int get_rule_mask_min_size(unsigned ruleno) const {
-    crush_rule *r = get_rule(ruleno);
-    if (IS_ERR(r)) return -1;
-    return r->mask.min_size;
-  }
-  int get_rule_mask_max_size(unsigned ruleno) const {
-    crush_rule *r = get_rule(ruleno);
-    if (IS_ERR(r)) return -1;
-    return r->mask.max_size;
+    return r->type;
   }
   int get_rule_op(unsigned ruleno, unsigned step) const {
     crush_rule_step *s = get_rule_step(ruleno, step);
@@ -1125,18 +1113,13 @@ public:
 
   /* modifiers */
 
-  int add_rule(int ruleno, int len, int type, int minsize, int maxsize) {
+  int add_rule(int ruleno, int len, int type) {
     if (!crush) return -ENOENT;
-    crush_rule *n = crush_make_rule(len, ruleno, type, minsize, maxsize);
+    crush_rule *n = crush_make_rule(len, type);
     ceph_assert(n);
     ruleno = crush_add_rule(crush, n, ruleno);
     return ruleno;
   }
-  int set_rule_mask_max_size(unsigned ruleno, int max_size) {
-    crush_rule *r = get_rule(ruleno);
-    if (IS_ERR(r)) return -1;
-    return r->mask.max_size = max_size;
-  }
   int set_rule_step(unsigned ruleno, unsigned step, int op, int arg1, int arg2) {
     if (!crush) return -ENOENT;
     crush_rule *n = get_rule(ruleno);
@@ -1382,7 +1365,7 @@ public:
   int find_first_rule(int type) const {
     for (size_t i = 0; i < crush->max_rules; ++i) {
       if (crush->rules[i]
-          && crush->rules[i]->mask.type == type) {
+          && crush->rules[i]->type == type) {
        return i;
       }
     }
index 04252265eeefb9dd07b77c9f2c27892810468a54..383f3e710de6b6f1f028d7dc4adda626ac7b2398 100644 (file)
@@ -98,17 +98,16 @@ int crush_add_rule(struct crush_map *map, struct crush_rule *rule, int ruleno)
        return r;
 }
 
-struct crush_rule *crush_make_rule(int len, int ruleid, int type, int minsize, int maxsize)
+struct crush_rule *crush_make_rule(int len, int type)
 {
        struct crush_rule *rule;
        rule = malloc(crush_rule_size(len));
         if (!rule)
                 return NULL;
        rule->len = len;
-       rule->mask.ruleset = ruleid;  // these always match now
-       rule->mask.type = type;
-       rule->mask.min_size = minsize;
-       rule->mask.max_size = maxsize;
+       rule->type = type;
+       rule->deprecated_min_size = 1;
+       rule->deprecated_max_size = 100;
        return rule;
 }
 
index 89e77850827aa4b871554226d301b255943b588e..ec093eebb30c69836ac32e3297a9a6e97a8de661 100644 (file)
@@ -37,14 +37,7 @@ extern void crush_finalize(struct crush_map *map);
 /** @ingroup API
  *
  * Allocate an empty crush_rule structure large enough to store __len__ steps.
- * Steps can be added to a rule via crush_rule_set_step(). 
- *
- * The rule is designed to allow crush_do_rule() to get at least __minsize__ items
- * and at most __maxsize__ items.
- *
- * The __type__ is defined by the caller and will be used by
- * crush_find_rule() when looking for a rule and by
- * __CRUSH_RULE_CHOOSE*__ steps when looking for items.
+ * Steps can be added to a rule via crush_rule_set_step().
  *
  * The caller is responsible for deallocating the returned pointer via
  * crush_destroy_rule().
@@ -52,14 +45,11 @@ extern void crush_finalize(struct crush_map *map);
  * If __malloc(3)__ fails, return NULL.
  *
  * @param len number of steps in the rule
- * @param ruleid user defined value
  * @param type user defined value
- * @param minsize minimum number of items the rule can map
- * @param maxsize maximum number of items the rule can map
  *
  * @returns a pointer to the newly created rule or NULL
  */
-extern struct crush_rule *crush_make_rule(int len, int ruleid, int type, int minsize, int maxsize);
+extern struct crush_rule *crush_make_rule(int len, int type);
 /** @ingroup API
  *
  * Set the __pos__ step of the __rule__ to an operand and up to two arguments.
index 9d49a958af9d65fb7b9007d0ad183ec6bd546250..fde2df6a8a3ec7cef8c59b253c9122eeea0a0b88 100644 (file)
@@ -75,21 +75,12 @@ enum crush_opcodes {
 #define CRUSH_CHOOSE_N            0
 #define CRUSH_CHOOSE_N_MINUS(x)   (-(x))
 
-/*
- * The rule mask is used to describe what the rule is intended for.
- * Given a ruleset and size of output set, we search through the
- * rule list for a matching rule_mask.
- */
-struct crush_rule_mask {
-       __u8 ruleset;   /* always matches rule_id now */
-       __u8 type;
-       __u8 min_size;
-       __u8 max_size;
-};
-
 struct crush_rule {
        __u32 len;
-       struct crush_rule_mask mask;
+       __u8 __unused_was_rule_mask_ruleset;
+       __u8 type;
+       __u8 deprecated_min_size;
+       __u8 deprecated_max_size;
        struct crush_rule_step steps[0];
 };
 
index 582e502e64044466ae1623800f397ca088330ffd..b5c356a49e17e8bafc9c18188a6fecf08e643b72 100644 (file)
@@ -170,9 +170,9 @@ struct crush_grammar : public boost::spirit::grammar<crush_grammar>
                                step_emit );
       crushrule = str_p("rule") >> !name >> '{'
                                >> (str_p("id") | str_p("ruleset")) >> posint
-                          >> str_p("type") >> ( str_p("replicated") | str_p("erasure") )
-                          >> str_p("min_size") >> posint
-                          >> str_p("max_size") >> posint
+                               >> str_p("type") >> ( str_p("replicated") | str_p("erasure") )
+                               >> !(str_p("min_size") >> posint)
+                               >> !(str_p("max_size") >> posint)
                           >> +step
                           >> '}';
 
index 0cebf9a98022f865b22b08942630571cd74c1227..5212baee25187072512da7bd137ae640cf92bf96 100644 (file)
@@ -78,7 +78,6 @@ int ErasureCode::create_rule(
   if (ruleid < 0)
     return ruleid;
 
-  crush.set_rule_mask_max_size(ruleid, get_chunk_count());
   return ruleid;
 }
 
index 766a94e4519d893a40a5f7d4a771d4cc75ed0413..f66b0fc4669d79c71678274f3d785625d0c4e6ca 100644 (file)
@@ -76,11 +76,8 @@ int ErasureCodeLrc::create_rule(const string &name,
   }
 
   int steps = 4 + rule_steps.size();
-  int min_rep = 3;
-  int max_rep = get_chunk_count();
   int ret;
-  ret = crush.add_rule(rno, steps, pg_pool_t::TYPE_ERASURE,
-                      min_rep, max_rep);
+  ret = crush.add_rule(rno, steps, pg_pool_t::TYPE_ERASURE);
   ceph_assert(ret == rno);
   int step = 0;
 
index b09367df14cebd037e946655f88cbe54c9b961dc..f5e215be13f2d47a72c3011d95cf219eec865908 100644 (file)
@@ -41,8 +41,6 @@
   rule data {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -50,8 +48,6 @@
   rule metadata {
   \tid 1 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -59,8 +55,6 @@
   rule rbd {
   \tid 2 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
index 879097725ed0358c34776d6e5d47297c8f0d3e9b..4689efc6eda72ffb7412b9a51179b8c010ea5e89 100644 (file)
@@ -7,4 +7,4 @@
   $ crushtool -i six   --add-item 6 1.0 device6 --loc host host0 --loc cluster cluster0 -o seven > /dev/null
   $ crushtool -i seven --add-item 7 1.0 device7 --loc host host0 --loc cluster cluster0 -o eight > /dev/null
   $ crushtool -d eight -o final
-  $ cmp final "$TESTDIR/tree.template.final"
+  $ diff final "$TESTDIR/tree.template.final"
index b0e4601d6737b894d325534f302171adb10223da..dc056d005d22369fcf69fefb56e304105bdc2d3d 100644 (file)
@@ -34,8 +34,6 @@
   rule data {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -43,8 +41,6 @@
   rule metadata {
   \tid 1 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -52,8 +48,6 @@
   rule rbd {
   \tid 2 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -61,8 +55,6 @@
   rule simple-rule {
   \tid 3 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
   rule data {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
   rule metadata {
   \tid 1 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
   rule rbd {
   \tid 2 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take cluster0 (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
   
   # end crush map
   $ crushtool -d two -o final
-  $ cmp final "$TESTDIR/simple.template.two"
+  $ diff final "$TESTDIR/simple.template.two"
   $ crushtool -i two --add-item 1 1.0 device1 --loc host host0 --loc cluster cluster0 -o three 2>/dev/null >/dev/null || echo FAIL
   FAIL
   $ crushtool -i two --remove-item device1 -o four > /dev/null
   $ crushtool -d four -o final
-  $ cmp final "$TESTDIR/simple.template.four"
+  $ diff final "$TESTDIR/simple.template.four"
   $ crushtool -i two --update-item 1 2.0 osd1 --loc host host1 --loc cluster cluster0 -o five > /dev/null
   $ crushtool -d five -o final
-  $ cmp final "$TESTDIR/simple.template.five"
+  $ diff final "$TESTDIR/simple.template.five"
   $ crushtool -i five --update-item 1 2.0 osd1 --loc host host1 --loc cluster cluster0 -o six > /dev/null
   $ crushtool -i five --show-location 1
   cluster\tcluster0 (esc)
   host\thost1 (esc)
   $ crushtool -d six -o final
-  $ cmp final "$TESTDIR/simple.template.five"
+  $ diff final "$TESTDIR/simple.template.five"
index 16d7135ca6cb7c8b9d94338249645cf04057b1d8..a6f2161b9e6e07fc13f9c894c4dc2022391a7cfb 100644 (file)
@@ -6,7 +6,7 @@
 
   $ crushtool -i one --add-item 0 2.0 device0 --loc host fake --loc cluster cluster0 -o two > /dev/null
   $ crushtool -d two -o final
-  $ cmp final "$TESTDIR/simple.template.adj.two"
+  $ diff final "$TESTDIR/simple.template.adj.two"
 
 #
 # update the weight of device0 in host=host0, it will not affect the weight of device0 in host=fake
@@ -14,4 +14,4 @@
 
   $ crushtool -i two --update-item 0 3.0 device0 --loc host host0 --loc cluster cluster0 -o three > /dev/null
   $ crushtool -d three -o final
-  $ cmp final "$TESTDIR/simple.template.adj.three"
+  $ diff final "$TESTDIR/simple.template.adj.three"
index 85c8748d50569a05675c497561297fd27d56ff2e..2182f87e7e581f269d14bcb8077eedea813be044 100644 (file)
   rule replicated_rule {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take root (esc)
   \tstep chooseleaf firstn 0 type node (esc)
   \tstep emit (esc)
index f2bb4da574393eadfc6727ef238b22979c901170..69718ffba3f555d66027401152fe12cb0f2870ba 100644 (file)
@@ -21,8 +21,6 @@ domain root {
 rule rule-firstn {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take root
        step choose firstn 0 type osd
        step emit
@@ -31,8 +29,6 @@ rule rule-firstn {
 rule rule-indep {
        id 1
        type erasure
-       min_size 1
-       max_size 10
        step take root
        step choose indep 0 type osd
        step emit
index c6aff9d5b635dcf96e22c9eb6fda6349a97a615a..89d56abeea7dad0e3a461299e9c273f746430b12 100644 (file)
@@ -54,8 +54,6 @@
   rule replicated_rule {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take root (esc)
   \tstep chooseleaf firstn 0 type root (esc)
   \tstep emit (esc)
index b041aa490338ab17c96dde2fbc48bb3c9b3951ad..b87342c7088d0b2a76617252976c01b037cf2c67 100644 (file)
@@ -21,8 +21,6 @@ host host0 {
 rule rule-r0 {
        id 0
        type replicated
-       min_size 1
-       max_size 3
        step take host0
        step choose firstn 0 type osd
        step emit
@@ -31,8 +29,6 @@ rule rule-r0 {
 rule rule-r1 {
        id 0
        type replicated
-       min_size 1
-       max_size 1
        step take host0
        step choose firstn 0 type osd
        step emit
@@ -41,8 +37,6 @@ rule rule-r1 {
 rule rule-r2 {
        id 0
        type replicated
-       min_size 1
-       max_size 2
        step take host0
        step choose firstn 0 type osd
        step emit
@@ -51,8 +45,6 @@ rule rule-r2 {
 rule rule-r3 {
        id 0
        type replicated
-       min_size 2
-       max_size 3
        step take host0
        step choose indep 0 type osd
        step emit
@@ -61,8 +53,6 @@ rule rule-r3 {
 rule rule-r4 {
        id 0
        type replicated
-       min_size 4
-       max_size 5
        step take host0
        step choose indep 0 type osd
        step emit
@@ -71,8 +61,6 @@ rule rule-r4 {
 rule rule-e0 {
        id 0
        type erasure
-       min_size 1
-       max_size 10
        step take host0
        step choose indep 0 type osd
        step emit
@@ -81,8 +69,6 @@ rule rule-e0 {
 rule rule-e1 {
        id 1
        type erasure
-       min_size 1
-       max_size 10
        step take host0
        step choose indep 0 type osd
        step emit
index ed0bc962c399640dd09692fd92fe34e3229ed8c9..06da21f3267d5a4dedb40f946b9b5431e217df2e 100644 (file)
@@ -54,8 +54,6 @@ root root {
 rule data {
        id 3
        type replicated
-       min_size 2
-       max_size 2
        step take root
        step chooseleaf firstn 0 type rack
        step emit
index 1febf220c949785c4d70b4f7f451c9f7a258f5b3..e0956ec0a754dced5ab32dd8a67357c81a07049b 100644 (file)
               "rule_id": 3,
               "rule_name": "data",
               "type": 1,
-              "min_size": 2,
-              "max_size": 2,
               "steps": [
                   {
                       "op": "take",
index 7a1b61da8dfae02f2233089a5366c2a8eac2a9a0..dac7ee9c42febb6e73a8d2b205af0e7a47b29036 100644 (file)
@@ -11,5 +11,7 @@
   $ cmp nto.compiled nto.recompiled
 
   $ crushtool -c "$TESTDIR/missing-bucket.crushmap.txt"
+  WARNING: min_size is no longer supported, ignoring
+  WARNING: max_size is no longer supported, ignoring
   in rule 'rule-bad' item 'root-404' not defined
   [1]
index 106f3816fd052078727ab82d1fc72e14bc55dedc..adc4403aade67f88e6ae54a7a7670ae65986b157 100644 (file)
@@ -64,8 +64,6 @@ root root {
 rule data-ssd {
        id 1
        type replicated
-       min_size 2
-       max_size 2
        step take root class ssd
        step chooseleaf firstn 0 type rack
        step emit
@@ -73,8 +71,6 @@ rule data-ssd {
 rule data-hdd {
        id 2
        type replicated
-       min_size 2
-       max_size 2
        step take root class hdd
        step chooseleaf firstn 0 type rack
        step emit
@@ -82,8 +78,6 @@ rule data-hdd {
 rule data {
        id 3
        type replicated
-       min_size 2
-       max_size 2
        step take root
        step chooseleaf firstn 0 type rack
        step emit
index f99a9f091975d58d75f93818eb4bfd903bacff86..e0becef7de67bdffb68809c7f16fbea5bd37545c 100644 (file)
@@ -1,2 +1,4 @@
   $ crushtool -c "$TESTDIR/empty-default.cushmap.txt"
+  WARNING: min_size is no longer supported, ignoring
+  WARNING: max_size is no longer supported, ignoring
   crushtool successfully built or modified map.  Use '-o <file>' to write it out.
index 9f4b1fd5707a439526e6491eedba6b9569e3f103..b571ad2879309dca8a4296029c79cf31f22744f1 100644 (file)
@@ -59,8 +59,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -68,8 +66,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -77,8 +73,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index a787bdc3407a9360a3747eac21f1ddaa3755b5c0..30a1e6b9a1f7900db2f7c77dd2dc8a4154f7d4e8 100644 (file)
@@ -59,8 +59,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -68,8 +66,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -77,8 +73,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index b0a7df71a9c4c9cc5c163a83e343b8ae1a63cad0..7d7830064232ee20c5e33814c7cdcb6fc14ec229 100644 (file)
@@ -54,8 +54,6 @@ root root {
 rule data {
        id 1
        type replicated
-       min_size 2
-       max_size 2
        step take root
        step chooseleaf firstn 0 type rack
        step emit
index 6e59e57c57341e8696628a5c212047b75e1017ff..2db354f20f7aeaaac205613c1519819f050f571a 100644 (file)
@@ -1,4 +1,6 @@
   $ crushtool -c $TESTDIR/rules.txt --create-replicated-rule foo default host -o one > /dev/null
+  WARNING: min_size is no longer supported, ignoring
+  WARNING: max_size is no longer supported, ignoring
   $ crushtool -d one
   # begin crush map
   
@@ -53,8 +55,6 @@
   rule data {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take default (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -62,8 +62,6 @@
   rule foo {
   \tid 1 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take default (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
@@ -81,6 +79,8 @@
 
 
   $ crushtool -c $TESTDIR/rules.txt --create-replicated-rule foo-ssd default host -o two --device-class ssd > /dev/null
+  WARNING: min_size is no longer supported, ignoring
+  WARNING: max_size is no longer supported, ignoring
   $ crushtool -d two
   # begin crush map
   
   rule data {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take default (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
   rule foo-ssd {
   \tid 1 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take default class ssd (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
index f9f85c24548cebd22c05e4d0b1a79ec65e2a6b4e..b8f9fd25b68820b32f8d914335147cd7342370de 100644 (file)
@@ -70,8 +70,6 @@ root root0 {
 rule choose {
        id 0
        type replicated
-       min_size 2
-       max_size 3
        step take root0
        step choose firstn 0 type host
        step choose firstn 1 type device
@@ -81,8 +79,6 @@ rule choose {
 rule choose-two {
        id 1
        type replicated
-       min_size 2
-       max_size 3
        step take root0
        step choose firstn 0 type device
        step emit
@@ -91,8 +87,6 @@ rule choose-two {
 rule chooseleaf {
        id 2
        type replicated
-       min_size 2
-       max_size 3
        step take root0
        step chooseleaf firstn 0 type host
        step emit
@@ -101,8 +95,6 @@ rule chooseleaf {
 rule choose-set {
        id 3
        type replicated
-       min_size 2
-       max_size 3
        step set_choose_tries 3
        step set_choose_local_tries 2
        step set_choose_local_fallback_tries 2
@@ -116,8 +108,6 @@ rule choose-set {
 rule choose-set-two {
        id 4
        type replicated
-       min_size 2
-       max_size 3
        step set_choose_tries 3
        step set_choose_local_tries 2
        step set_choose_local_fallback_tries 2
@@ -130,8 +120,6 @@ rule choose-set-two {
 rule chooseleaf-set {
        id 5
        type replicated
-       min_size 2
-       max_size 3
        step set_choose_tries 3
        step set_choose_local_tries 2
        step set_choose_local_fallback_tries 2
index 9a961c8c81e0e4328b1234e9f8f20ea863c002ca..c467408b433781337d725fe5e2ea6e464e33d67b 100644 (file)
@@ -27,8 +27,6 @@ root root {
 rule first_rule {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take root
        step choose firstn 0 type device
        step emit
@@ -37,8 +35,6 @@ rule first_rule {
 rule indep_rule {
     id 1
     type erasure
-    min_size 3
-    max_size 20
     step set_chooseleaf_tries 5
     step take root
     step choose indep 0 type device
index 94c243de76d75e36533d9780db08221d27ad14bb..faf02c72c1dabd3941d3b4b100992936ea6a9b63 100644 (file)
@@ -28,8 +28,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -37,8 +35,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -46,8 +42,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index eaadca595cabbc9b01c5492c9b9be6093e425511..52fed1f14a0f400ba0d309fa07066d31a154867e 100644 (file)
@@ -36,8 +36,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -45,8 +43,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -54,8 +50,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 15734891c63dca9fda72a12061664bfd323a1200..00cb81055d3b22347cdab5a8bb417bc92f84ec7c 100644 (file)
@@ -36,8 +36,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -45,8 +43,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -54,8 +50,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 7d9c8842be362f15b8def1d5ca66382fc465e402..74c53abebb7c8e3d7bf0afac5a4aec4729014cf4 100644 (file)
@@ -37,8 +37,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -46,8 +44,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -55,8 +51,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 94c243de76d75e36533d9780db08221d27ad14bb..faf02c72c1dabd3941d3b4b100992936ea6a9b63 100644 (file)
@@ -28,8 +28,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -37,8 +35,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -46,8 +42,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 05d18b2761d78ca2ef555a328ba2258588fa602d..c3ab1ff534b31853c3b73975571e34caaff06972 100644 (file)
@@ -42,8 +42,6 @@ cluster cluster1 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -51,8 +49,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -60,8 +56,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster1
        step chooseleaf firstn 0 type host
        step emit
index bfffbc6677b2746ce9bd0a52cbd505efd3ea52a8..daaf34ac7807f04e4944b7e9f679827e34f65b85 100644 (file)
@@ -45,8 +45,6 @@ cluster cluster1 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -54,8 +52,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -63,8 +59,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster1
        step chooseleaf firstn 0 type host
        step emit
index 4dcb1505d85638a0b380f27142859a5180f018b1..33ebc662a257368c3ddf3d8997f0fac738dee712 100644 (file)
@@ -30,8 +30,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -39,8 +37,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -48,8 +44,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 4dcb1505d85638a0b380f27142859a5180f018b1..33ebc662a257368c3ddf3d8997f0fac738dee712 100644 (file)
@@ -30,8 +30,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -39,8 +37,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -48,8 +44,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 754f45e10b483a53161020229c54a2499239c65d..c87db75d0904cbf30901f4818b5d5be3d2b9a6bb 100644 (file)
@@ -33,8 +33,6 @@ default default {
 rule replicated_rule {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take default
        step chooseleaf firstn 0 type host
        step emit
index 59bc09811b6d068e4d78b5d1f3004f971125f974..bac9e392d77c6ee3165d9c46aeaedf10ca9c4a3e 100644 (file)
@@ -421,8 +421,6 @@ default root {
 rule myrule {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take root
        step choose firstn 2 type rack
        step chooseleaf indep 4 type host
@@ -432,8 +430,6 @@ rule myrule {
 rule myrule1 {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take root
        step choose firstn 2 type rack
        step chooseleaf indep 1 type host
index 3c0680ac8d1f38a8005c47885f85ed720e07f0d2..c46ba3cbe5479d9357029cd7939b147c62d7559c 100644 (file)
@@ -42,8 +42,6 @@ cluster cluster0 {
 rule data {
        id 0
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -51,8 +49,6 @@ rule data {
 rule metadata {
        id 1
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
@@ -60,8 +56,6 @@ rule metadata {
 rule rbd {
        id 2
        type replicated
-       min_size 1
-       max_size 10
        step take cluster0
        step chooseleaf firstn 0 type host
        step emit
index 08f0836d30a5284a4f54a93f268b762d3ff0b897..9d745b82f9870cbde870a5f4c8d417d2a96ef54a 100644 (file)
@@ -64,8 +64,6 @@
   rule replicated_rule {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take default (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
index 34bd82579962d221e0719d063afd45a03557ae79..d1e65d7b5c8f4c1d986b24691e82a0f40af66c7b 100644 (file)
   rule replicated_rule {
   \tid 0 (esc)
   \ttype replicated (esc)
-  \tmin_size 1 (esc)
-  \tmax_size 10 (esc)
   \tstep take default (esc)
   \tstep chooseleaf firstn 0 type host (esc)
   \tstep emit (esc)
index def46fbb4b00e94b6fa3714156fc689a0e65d725..07410ac81f19b3625c7e496b08fb8057dbac4bbe 100644 (file)
@@ -1416,7 +1416,7 @@ TEST_F(CrushWrapperTest, try_remap_rule) {
   // choose + choose
   {
     cout << "take + choose + choose + choose + emit" << std::endl;
-    int rule = c.add_rule(2, 5, 0, 1, 10);
+    int rule = c.add_rule(2, 5, 0);
     ASSERT_EQ(2, rule);
     c.set_rule_step_take(rule, 0, bno);
     c.set_rule_step_choose_indep(rule, 1, 2, 2);
index f99dedbe836b39853cad920b04243ede658d2efb..e9421988d9d6f65eb1c2203132ce846669895e0d 100644 (file)
@@ -53,7 +53,7 @@ std::unique_ptr<CrushWrapper> build_indep_map(CephContext *cct, int num_rack,
   }
   int ret;
   int ruleno = 0;
-  ret = c->add_rule(ruleno, 4, 123, 1, 20);
+  ret = c->add_rule(ruleno, 4, 123);
   ceph_assert(ret == ruleno);
   ret = c->set_rule_step(ruleno, 0, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 10, 0);
   ceph_assert(ret == 0);
index 4657553174c023818a3641ccfcd9a5bb472d59db..4a2f2458f29ca9d7b185550180aaab89af6b3182 100644 (file)
@@ -829,10 +829,8 @@ TEST_F(OSDMapTest, CleanPGUpmaps) {
     }
     string root_name = "default";
     int root = crush.get_item_id(root_name);
-    int min_size = 3;
-    int max_size = 4;
     int steps = 6;
-    crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+    crush_rule *rule = crush_make_rule(steps, rule_type);
     int step = 0;
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
@@ -1154,10 +1152,8 @@ TEST_F(OSDMapTest, BUG_38897) {
       if (!crush.rule_exists(rno))
         break;
     }
-    int min_size = 3;
-    int max_size = 3;
     int steps = 7;
-    crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+    crush_rule *rule = crush_make_rule(steps, rule_type);
     int step = 0;
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
@@ -1253,10 +1249,8 @@ TEST_F(OSDMapTest, BUG_38897) {
       if (!crush.rule_exists(rno))
         break;
     }
-    int min_size = 3;
-    int max_size = 3;
     int steps = 7;
-    crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+    crush_rule *rule = crush_make_rule(steps, rule_type);
     int step = 0;
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
@@ -1410,10 +1404,8 @@ TEST_F(OSDMapTest, BUG_42052) {
     if (!crush.rule_exists(rno))
       break;
   }
-  int min_size = 3;
-  int max_size = 3;
   int steps = 8;
-  crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+  crush_rule *rule = crush_make_rule(steps, rule_type);
   int step = 0;
   crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
   crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
@@ -1537,10 +1529,8 @@ TEST_F(OSDMapTest, BUG_42485) {
     int dc1 = crush.get_item_id(dc_1);
     string dc_2 = "dc-1";
     int dc2 = crush.get_item_id(dc_2);
-    int min_size = 1;
-    int max_size = 20;
     int steps = 8;
-    crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+    crush_rule *rule = crush_make_rule(steps, rule_type);
     int step = 0;
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
@@ -1764,12 +1754,10 @@ TEST_F(OSDMapTest, BUG_43124) {
       if (!crush.rule_exists(rno))
         break;
     }
-    int min_size = 1;
-    int max_size = 20;
     int steps = 6;
     string root_name = "default";
     int root = crush.get_item_id(root_name);
-    crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+    crush_rule *rule = crush_make_rule(steps, rule_type);
     int step = 0;
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
     crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);