]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: error out if setting ruleset-* ec profile property 17848/head
authorSage Weil <sage@redhat.com>
Wed, 20 Sep 2017 20:42:01 +0000 (16:42 -0400)
committerSage Weil <sage@redhat.com>
Sun, 24 Sep 2017 15:25:01 +0000 (11:25 -0400)
We change ruleset -> crush back in dc7a2aaf7a34b1e6af0c7b79dc44a69974c1da23.
If someone tries to use the old property, error out early, instead of
silently not doing the thing they thought they told us to do.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc

index d8f916d8f8e0a5a31a6d3d95acad3113eb5ab195..dee202f3bfb6dbd0e3b05fdde1aaf535a5212d30 100755 (executable)
@@ -2163,9 +2163,12 @@ function test_mon_osd_erasure_code()
   ceph osd erasure-code-profile set fooprofile a=b c=d e=f --force
   ceph osd erasure-code-profile set fooprofile a=b c=d e=f
   expect_false ceph osd erasure-code-profile set fooprofile a=b c=d e=f g=h
-  #
-  # cleanup by removing profile 'fooprofile'
+  # make sure ruleset-foo doesn't work anymore
+  expect_false ceph osd erasure-code-profile set barprofile ruleset-failure-domain=host
+  ceph osd erasure-code-profile set barprofile crush-failure-domain=host
+  # clean up
   ceph osd erasure-code-profile rm fooprofile
+  ceph osd erasure-code-profile rm barprofile
 }
 
 function test_mon_osd_misc()
index f583dffcce0951dd15926bbc124d3d318e847eb3..80075887cc47a0658469fd870680ef83551c8b1b 100644 (file)
@@ -5240,6 +5240,11 @@ int OSDMonitor::parse_erasure_code_profile(const vector<string> &erasure_code_pr
       const string key = i->substr(0, equal);
       equal++;
       const string value = i->substr(equal);
+      if (key.find("ruleset-") == 0) {
+       *ss << "property '" << key << "' is no longer supported; try "
+           << "'crush-" << key.substr(8) << "' instead";
+       return -EINVAL;
+      }
       user_map[key] = value;
       (*erasure_code_profile_map)[key] = value;
     }