From: Sage Weil Date: Tue, 8 Mar 2016 01:41:08 +0000 (-0500) Subject: crush: report minimum_required_version when dumping tunables X-Git-Tag: v10.1.0~112^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=565d1c73bde805c103b5093ec3c670ff1791d1a7;p=ceph.git crush: report minimum_required_version when dumping tunables This mimics the feature bit enforcement in OSDMap.cc but it does it based on the version string. This is useful when you have CRUSH tunables that aren't mapped to a named profile. Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 72739fd11a13..9fb420281708 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1568,6 +1568,9 @@ void CrushWrapper::dump_tunables(Formatter *f) const f->dump_int("optimal_tunables", (int)has_optimal_tunables()); f->dump_int("legacy_tunables", (int)has_legacy_tunables()); + // be helpful about minimum version required + f->dump_string("minimum_required_version", get_min_required_version()); + f->dump_int("require_feature_tunables", (int)has_nondefault_tunables()); f->dump_int("require_feature_tunables2", (int)has_nondefault_tunables2()); f->dump_int("has_v2_rules", (int)has_v2_rules()); diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 0c25bb9d3815..1f9c8789d909 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -316,6 +316,19 @@ public: bool is_v3_rule(unsigned ruleid) const; bool is_v5_rule(unsigned ruleid) const; + string get_min_required_version() const { + if (has_v5_rules() || has_nondefault_tunables5()) + return "jewel"; + else if (has_v4_buckets()) + return "hammer"; + else if (has_nondefault_tunables3()) + return "firefly"; + else if (has_nondefault_tunables2() || has_nondefault_tunables()) + return "bobtail"; + else + return "argonaut"; + } + // default bucket types unsigned get_default_bucket_alg() const { // in order of preference