]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: set_choose_tries = 100 for erasure code rulesets 4031/head
authorLoic Dachary <ldachary@redhat.com>
Wed, 17 Dec 2014 15:06:55 +0000 (16:06 +0100)
committerLoic Dachary <ldachary@redhat.com>
Tue, 17 Mar 2015 10:16:52 +0000 (11:16 +0100)
It is common for people to try to map 9 OSDs out of a 9 OSDs total ceph
cluster. The default tries (50) will frequently lead to bad mappings for
this use case. Changing it to 100 makes no significant CPU performance
difference, as tested manually by running crushtool on one million
mappings.

http://tracker.ceph.com/issues/10353 Fixes: #10353

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 2f87ac807f3cc7ac55d9677d2051645bf5396a62)

src/crush/CrushWrapper.cc
src/erasure-code/lrc/ErasureCodeLrc.cc

index 34d430da4b0a12a798c5ac71a9530729be0ae4fc..a1583853b768edd09396125174405ea46137ec78 100644 (file)
@@ -812,15 +812,17 @@ int CrushWrapper::add_simple_ruleset(string name, string root_name,
   }
   int steps = 3;
   if (mode == "indep")
-    steps = 4;
+    steps = 5;
   int min_rep = mode == "firstn" ? 1 : 3;
   int max_rep = mode == "firstn" ? 10 : 20;
   //set the ruleset the same as rule_id(rno)
   crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_rep, max_rep);
   assert(rule);
   int step = 0;
-  if (mode == "indep")
+  if (mode == "indep") {
     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);
+  }
   crush_rule_set_step(rule, step++, CRUSH_RULE_TAKE, root, 0);
   if (type)
     crush_rule_set_step(rule, step++,
index dd16252de72395fbd804a60439b37e745e00fcd7..d96460c4f526c32b8f35c920e81fdde9c555eaa8 100644 (file)
@@ -62,7 +62,7 @@ int ErasureCodeLrc::create_ruleset(const string &name,
   }
   ruleset = rno;
 
-  int steps = 3 + ruleset_steps.size();
+  int steps = 4 + ruleset_steps.size();
   int min_rep = 3;
   int max_rep = 30;
   int ret;
@@ -73,6 +73,8 @@ int ErasureCodeLrc::create_ruleset(const string &name,
 
   ret = crush.set_rule_step(rno, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
   assert(ret == 0);
+  ret = crush.set_rule_step(rno, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
+  assert(ret == 0);
   ret = crush.set_rule_step(rno, step++, CRUSH_RULE_TAKE, root, 0);
   assert(ret == 0);
   // [ [ "choose", "rack", 2 ],