]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ConfigMonitor: do not set NO_MON_UPDATE values
authorSage Weil <sage@redhat.com>
Sun, 19 Jan 2020 21:06:45 +0000 (15:06 -0600)
committerSage Weil <sage@redhat.com>
Mon, 20 Jan 2020 19:12:04 +0000 (13:12 -0600)
These options are special.  Since we can't get the values from the mon,
we also shouldn't store them there.  Most of them are not options that
can be changed anyway.

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

index cef30d09c0628626cf7682d50b5dbcf8c0bf3b26..981927bd0a5480f5de1af7e1cb4702bcae1e1609 100755 (executable)
@@ -93,12 +93,12 @@ do
 done
 ceph config show osd.0 | grep -c debug_asok | grep 0
 
-ceph config set osd.0 osd_data testorama
-while ! ceph config show osd.0 | grep osd_data | grep mon
+ceph config set osd.0 osd_scrub_cost 123
+while ! ceph config show osd.0 | grep osd_scrub_cost | grep mon
 do
     sleep 1
 done
-ceph config rm osd.0 osd_data
+ceph config rm osd.0 osd_scrub_cost
 
 # show-with-defaults
 ceph config show-with-defaults osd.0 | grep debug_asok
index 96332c0059c25c013cf99862999a9f91b6bf007b..f22dac578d34317298d0cd61aca5e61185a63e50 100644 (file)
@@ -494,14 +494,18 @@ bool ConfigMonitor::prepare_command(MonOpRequestRef op)
        goto reply;
       }
 
-      if (opt) {
-       Option::value_t real_value;
-       string errstr;
-       err = opt->parse_value(value, &real_value, &errstr, &value);
-       if (err < 0) {
-         ss << "error parsing value: " << errstr;
-         goto reply;
-       }
+      Option::value_t real_value;
+      string errstr;
+      err = opt->parse_value(value, &real_value, &errstr, &value);
+      if (err < 0) {
+       ss << "error parsing value: " << errstr;
+       goto reply;
+      }
+
+      if (opt->has_flag(Option::FLAG_NO_MON_UPDATE)) {
+       err = -EINVAL;
+       ss << name << " is special and cannot be stored by the mon";
+       goto reply;
       }
     }