]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: warn user doing "config key set mgr/..."
authorJohn Spray <john.spray@redhat.com>
Mon, 9 Apr 2018 19:37:55 +0000 (15:37 -0400)
committerJohn Spray <john.spray@redhat.com>
Mon, 23 Apr 2018 11:29:46 +0000 (07:29 -0400)
This is still completely legal, but isn't going
to have the effect they wanted if they were
trying to set a configuration option for a mgr module.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mon/ConfigKeyService.cc

index a9d78fcd33158df111e1dd2e49fa397cbfbd5e68..6dbdea91664eaa8ce3f0c731300a638786391594 100644 (file)
@@ -236,8 +236,22 @@ bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
          << "Use 'mon config key max entry size' to manually adjust";
       goto out;
     }
-    // we'll reply to the message once the proposal has been handled
+
+    std::string mgr_prefix = "mgr/";
+    if (key.size() >= mgr_prefix.size() &&
+        key.substr(0, mgr_prefix.size()) == mgr_prefix) {
+      // In <= mimic, we used config-key for mgr module configuration,
+      // and we bring values forward in an upgrade, but subsequent
+      // `set` operations will not be picked up.  Warn user about this.
+      ss << "WARNING: it looks like you might be trying to set a ceph-mgr "
+            "module configuration key.  Since Ceph 13.0.0 (Mimic), mgr module "
+            "configuration is done with `config set`, and new values "
+            "set using `config-key set` will be ignored.\n";
+    }
+
     ss << "set " << key;
+
+    // we'll reply to the message once the proposal has been handled
     store_put(key, data,
              new Monitor::C_Command(mon, op, 0, ss.str(), 0));
     // return for now; we'll put the message once it's done.