From 430a140d38ba6b9e07c53d5a4a5c6232bef4fb0e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 20 Sep 2017 16:42:01 -0400 Subject: [PATCH] mon/OSDMonitor: error out if setting ruleset-* ec profile property 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 (cherry picked from commit 6376d75eda648789b5e316a1ac2883708db7128e) --- qa/workunits/cephtool/test.sh | 7 +++++-- src/mon/OSDMonitor.cc | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index f5a313ea2a5af..a15272193e1ae 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -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() diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 46f702f4023e4..061ee18ebd11e 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -5628,6 +5628,11 @@ int OSDMonitor::parse_erasure_code_profile(const vector &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; } -- 2.39.5