From 15b695937be35d666c6e156d18e1cb56fbf0c4a6 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 27 Dec 2013 00:10:55 +0100 Subject: [PATCH] crush: set min_rep and max_rep depending on mode Assuming firstn is for replica and indep is for erasure. This is a strong constraint but it is unlikely to make the resulting ruleset unfit to be used in most cases. Signed-off-by: Loic Dachary --- src/crush/CrushWrapper.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 56674eb0336b3..77a2627977099 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -748,7 +748,9 @@ int CrushWrapper::add_simple_ruleset(string name, string root_name, int steps = 3; if (mode == "indep") steps = 4; - crush_rule *rule = crush_make_rule(steps, ruleset, rule_type, 1, 10); + int min_rep = mode == "firstn" ? 1 : 3; + int max_rep = mode == "firstn" ? 10 : 20; + crush_rule *rule = crush_make_rule(steps, ruleset, rule_type, min_rep, max_rep); assert(rule); int step = 0; if (mode == "indep") -- 2.39.5