]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: report minimum_required_version when dumping tunables
authorSage Weil <sage@redhat.com>
Tue, 8 Mar 2016 01:41:08 +0000 (20:41 -0500)
committerSage Weil <sage@redhat.com>
Fri, 11 Mar 2016 20:36:50 +0000 (15:36 -0500)
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 <sage@redhat.com>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index 72739fd11a13db072ae1f432b88835972ed397da..9fb420281708882a05acfa1db5f4442286a49176 100644 (file)
@@ -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());
index 0c25bb9d3815385a33154f580f3c1012db12ea4b..1f9c8789d90990f3dd2b47184655d5b1ac494823 100644 (file)
@@ -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