]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: add option to fix up ruleset-* to crush-* for ec profiles 18945/head
authorSage Weil <sage@redhat.com>
Wed, 15 Nov 2017 14:55:33 +0000 (08:55 -0600)
committerSage Weil <sage@redhat.com>
Sun, 19 Nov 2017 02:30:14 +0000 (20:30 -0600)
The jewel->luminous upgrade test will fail if we finish the upgrade while
a workload setting old-style ec profiles is running.  Add option to
automatically fix them up.  Warn to the cluster log when this happens.

For now, enable this option to ease upgrades and whitelist the warning.

Only include this option in luminous so that we implicitly sunset this
compatibility kludge immediately.

Fixes: http://tracker.ceph.com/issues/22128
Signed-off-by: Sage Weil <sage@redhat.com>
qa/releases/luminous-with-mgr.yaml
qa/releases/luminous.yaml
qa/workunits/cephtool/test.sh
src/common/options.cc
src/mon/OSDMonitor.cc

index d500803750ece62d628029caa73c13f0ba5768a5..391a5e1816d19564fdcb081f067216f751f11923 100644 (file)
@@ -8,3 +8,5 @@ overrides:
     conf:
       mon:
         mon warn on osd down out interval zero: false
+    log-whitelist:
+      - ruleset-
index 9ed76715a9603e0332567d96226ebbedc19756fc..5bd666ca004ca324ae156f1651708695f6842a6f 100644 (file)
@@ -19,3 +19,4 @@ overrides:
         mon warn on osd down out interval zero: false
     log-whitelist:
       - no active mgr
+      - ruleset-
index b70f6f9bf0fb5db47b48d07aac1403ab2c5af9e9..15344172a966cd972e851308566361c1b33bd00d 100755 (executable)
@@ -2153,8 +2153,8 @@ 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
-  # make sure ruleset-foo doesn't work anymore
-  expect_false ceph osd erasure-code-profile set barprofile ruleset-failure-domain=host
+  # ruleset-foo will work for luminous only
+  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
index 269923239ca0fbcd9b8acc7dcbe32216fdba1e6a..414f091d830b0512a651133f3d9a83f95e5b2b52 100644 (file)
@@ -1298,6 +1298,10 @@ std::vector<Option> get_global_options() {
     .set_default(false)
     .set_description(""),
 
+    Option("mon_fixup_legacy_erasure_code_profiles", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(true)
+    .set_description("Automatically adjust ruleset-* to crush-* so that legacy apps can set modern erasure code profiles without modification"),
+
     Option("mon_debug_deprecated_as_obsolete", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(false)
     .set_description(""),
index 4702ae14f1b23891298517e77a437c0730db53aa..c9ff10b345f72ecb7c7c3353f45fd4a3718f23e8 100644 (file)
@@ -5816,13 +5816,21 @@ int OSDMonitor::parse_erasure_code_profile(const vector<string> &erasure_code_pr
       user_map[*i] = string();
       (*erasure_code_profile_map)[*i] = string();
     } else {
-      const string key = i->substr(0, equal);
+      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;
+       if (osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS &&
+           g_conf->get_val<bool>("mon_fixup_legacy_erasure_code_profiles")) {
+         mon->clog->warn() << "erasure code profile property '" << key
+                           << "' is no longer supported; try "
+                           << "'crush-" << key.substr(8) << "' instead";
+         key = string("crush-") + key.substr(8);
+       } else {
+         *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;