]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: error out if setting ruleset-* ec profile property 17936/head
authorSage Weil <sage@redhat.com>
Wed, 20 Sep 2017 20:42:01 +0000 (16:42 -0400)
committerSage Weil <sage@redhat.com>
Mon, 25 Sep 2017 02:17:16 +0000 (22:17 -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>
(cherry picked from commit 6376d75eda648789b5e316a1ac2883708db7128e)

qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc

index f5a313ea2a5aff846efba6baaecd69ede8a9df59..a15272193e1ae67123ea786dac7f43d1075b2405 100755 (executable)
@@ -2162,9 +2162,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 46f702f4023e47810a1d12ba7cbf123a14c92720..061ee18ebd11e378998cae2de1b24b16445c7e1c 100644 (file)
@@ -5628,6 +5628,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;
     }