From: Sage Weil Date: Sun, 19 Jan 2020 21:06:45 +0000 (-0600) Subject: mon/ConfigMonitor: do not set NO_MON_UPDATE values X-Git-Tag: v15.1.0~117^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=02a745f8c9ac370e0968c4c38b4550d7a5d60542;p=ceph.git mon/ConfigMonitor: do not set NO_MON_UPDATE values 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 --- diff --git a/qa/workunits/mon/config.sh b/qa/workunits/mon/config.sh index cef30d09c06..981927bd0a5 100755 --- a/qa/workunits/mon/config.sh +++ b/qa/workunits/mon/config.sh @@ -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 diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index 96332c0059c..f22dac578d3 100644 --- a/src/mon/ConfigMonitor.cc +++ b/src/mon/ConfigMonitor.cc @@ -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; } }