From 08fa34d94e40f2f7230dec4dabad72107cdee27b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 23 Jan 2014 09:16:54 -0800 Subject: [PATCH] osd/OSDMap: do not create erasure rule by default If we do, we will require the v2 feature bit from clients. We could only include feature bits for rules that are actually referenced by pools, but for now making the user create the rule is simpler. There is no need to create this rule ahead of time. Signed-off-by: Sage Weil --- src/osd/OSDMap.cc | 9 +++------ src/test/cli/crushtool/build.t | 10 ---------- src/test/cli/osdmaptool/create-print.t | 10 ---------- src/test/cli/osdmaptool/create-racks.t | 10 ---------- 4 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index ed341aa0cffb8..8361bf70f751f 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2081,10 +2081,7 @@ int OSDMap::build_simple_crush_rulesets(CephContext *cct, "firstn", pg_pool_t::TYPE_REPLICATED, ss); if (r < 0) return r; - r = crush.add_simple_ruleset("erasure_ruleset", root, failure_domain, - "indep", pg_pool_t::TYPE_ERASURE, ss); - if (r < 0) - return r; - else - return 0; + // do not add an erasure rule by default or else we will implicitly + // require the crush_v2 feature of clients + return 0; } diff --git a/src/test/cli/crushtool/build.t b/src/test/cli/crushtool/build.t index e7a56327118b4..ca0804ded6073 100644 --- a/src/test/cli/crushtool/build.t +++ b/src/test/cli/crushtool/build.t @@ -87,16 +87,6 @@ \tstep chooseleaf firstn 0 type root (esc) \tstep emit (esc) } - rule erasure_ruleset { - \truleset 1 (esc) - \ttype erasure (esc) - \tmin_size 3 (esc) - \tmax_size 20 (esc) - \tstep set_chooseleaf_tries 5 (esc) - \tstep take root (esc) - \tstep chooseleaf indep 0 type root (esc) - \tstep emit (esc) - } # end crush map $ rm "$map" "$map.txt" diff --git a/src/test/cli/osdmaptool/create-print.t b/src/test/cli/osdmaptool/create-print.t index c95d9d30a3bc0..c8e405e2a865c 100644 --- a/src/test/cli/osdmaptool/create-print.t +++ b/src/test/cli/osdmaptool/create-print.t @@ -65,16 +65,6 @@ \tstep chooseleaf firstn 0 type host (esc) \tstep emit (esc) } - rule erasure_ruleset { - \truleset 1 (esc) - \ttype erasure (esc) - \tmin_size 3 (esc) - \tmax_size 20 (esc) - \tstep set_chooseleaf_tries 5 (esc) - \tstep take default (esc) - \tstep chooseleaf indep 0 type host (esc) - \tstep emit (esc) - } # end crush map $ osdmaptool --print myosdmap diff --git a/src/test/cli/osdmaptool/create-racks.t b/src/test/cli/osdmaptool/create-racks.t index 426cb869ff6a9..048f474fd5c37 100644 --- a/src/test/cli/osdmaptool/create-racks.t +++ b/src/test/cli/osdmaptool/create-racks.t @@ -773,16 +773,6 @@ \tstep chooseleaf firstn 0 type host (esc) \tstep emit (esc) } - rule erasure_ruleset { - \truleset 1 (esc) - \ttype erasure (esc) - \tmin_size 3 (esc) - \tmax_size 20 (esc) - \tstep set_chooseleaf_tries 5 (esc) - \tstep take default (esc) - \tstep chooseleaf indep 0 type host (esc) - \tstep emit (esc) - } # end crush map $ rm oc -- 2.39.5