]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: set_choose_tries = 100 for erasure code rulesets
authorLoic Dachary <ldachary@redhat.com>
Wed, 17 Dec 2014 15:06:55 +0000 (16:06 +0100)
committerLoic Dachary <ldachary@redhat.com>
Thu, 15 Jan 2015 20:26:53 +0000 (21:26 +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>
src/crush/CrushWrapper.cc
src/erasure-code/lrc/ErasureCodeLrc.cc

index 8e5601cd5de1e5360b3077dec5eaa0aa60fe73ab..150ba72a0381971fdfebf09e2cf1275e96a8a345 100644 (file)
@@ -923,15 +923,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 c6ae326f32b981b9333f958f6b98e975625ddd61..b198350527f3f821808def752e36664480d574c4 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 ],