]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove old-style mgr config opt usage
authorJohn Spray <john.spray@redhat.com>
Wed, 30 Aug 2017 11:12:40 +0000 (12:12 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 18 Sep 2017 11:21:09 +0000 (07:21 -0400)
Signed-off-by: John Spray <john.spray@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/MgrMonitor.cc
src/mon/Monitor.cc

index 17e21773cbefab9d5a32c93c8884e57562f579fb..40feeadd355b8b52d58d5fbc5237733bf884fc3b 100644 (file)
@@ -264,7 +264,6 @@ OPTION(mon_max_mdsmap_epochs, OPT_INT)
 OPTION(mon_max_osd, OPT_INT)
 OPTION(mon_probe_timeout, OPT_DOUBLE)
 OPTION(mon_client_bytes, OPT_U64)  // client msg data allowed in memory (in bytes)
-OPTION(mon_mgr_proxy_client_bytes_ratio, OPT_FLOAT) // ratio of mon_client_bytes that can be consumed by proxied mgr commands before we error out to client
 OPTION(mon_log_max_summary, OPT_U64)
 OPTION(mon_daemon_bytes, OPT_U64)  // mds, osd message memory cap (in bytes)
 OPTION(mon_max_log_entries_per_event, OPT_INT)
@@ -1557,10 +1556,6 @@ OPTION(mgr_mon_messages, OPT_U64)        // messages from mons
 OPTION(mgr_connect_retry_interval, OPT_DOUBLE)
 OPTION(mgr_service_beacon_grace, OPT_DOUBLE)
 
-OPTION(mon_mgr_digest_period, OPT_INT)  // How frequently to send digests
-OPTION(mon_mgr_beacon_grace, OPT_INT)  // How long to wait to failover
-OPTION(mon_mgr_inactive_grace, OPT_INT) // How long before health WARN -> ERR
-OPTION(mon_mgr_mkfs_grace, OPT_INT) // How long before we complain about MGR_DOWN
 OPTION(rgw_crypt_require_ssl, OPT_BOOL) // requests including encryption key headers must be sent over ssl
 OPTION(rgw_crypt_default_encryption_key, OPT_STR) // base64 encoded key for encryption of rgw objects
 OPTION(rgw_crypt_s3_kms_encryption_keys, OPT_STR) // extra keys that may be used for aws:kms
index e6f85340ecac731e32c123cc98cd4ba914cbf563..15f27f3f4421394af51b25f3c0e3c966f1490436 100644 (file)
@@ -1146,7 +1146,9 @@ std::vector<Option> get_global_options() {
     .set_description(""),
 
     Option("mon_mgr_proxy_client_bytes_ratio", Option::TYPE_FLOAT, Option::LEVEL_DEV)
-    .set_default(.3),
+    .set_default(.3)
+    .set_description("ratio of mon_client_bytes that can be consumed by "
+                     "proxied mgr commands before we error out to client"),
 
     Option("mon_log_max_summary", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(50)
index cc0ffe673d73fe95f78ab89988f3c2da8586eafd..79b2a00233de1aec9ea7f69fb80ded069e89d10e 100644 (file)
@@ -42,7 +42,9 @@ const static std::string command_descs_prefix = "mgr_command_descs";
 
 void MgrMonitor::create_initial()
 {
-  boost::tokenizer<> tok(g_conf->mgr_initial_modules);
+  // Take a local copy of initial_modules for tokenizer to iterate over.
+  auto initial_modules = g_conf->get_val<std::string>("mgr_initial_modules");
+  boost::tokenizer<> tok(initial_modules);
   for (auto& m : tok) {
     pending_map.modules.insert(m);
   }
@@ -119,10 +121,10 @@ health_status_t MgrMonitor::should_warn_about_mgr_down()
   // no OSDs are ever created.
   if (ever_had_active_mgr ||
       (mon->osdmon()->osdmap.get_num_osds() > 0 &&
-       now > mon->monmap->created + g_conf->mon_mgr_mkfs_grace)) {
+       now > mon->monmap->created + g_conf->get_val<int64_t>("mon_mgr_mkfs_grace"))) {
     health_status_t level = HEALTH_WARN;
     if (first_seen_inactive != utime_t() &&
-       now - first_seen_inactive > g_conf->mon_mgr_inactive_grace) {
+       now - first_seen_inactive > g_conf->get_val<int64_t>("mon_mgr_inactive_grace")) {
       level = HEALTH_ERR;
     }
     return level;
@@ -453,7 +455,7 @@ void MgrMonitor::send_digests()
   }
 
   digest_event = mon->timer.add_event_after(
-    g_conf->mon_mgr_digest_period,
+    g_conf->get_val<int64_t>("mon_mgr_digest_period"),
     new C_MonContext(mon, [this](int) {
       send_digests();
   }));
@@ -480,7 +482,7 @@ void MgrMonitor::tick()
     return;
 
   const auto now = ceph::coarse_mono_clock::now();
-  const auto cutoff = now - std::chrono::seconds(g_conf->mon_mgr_beacon_grace);
+  const auto cutoff = now - std::chrono::seconds(g_conf->get_val<int64_t>("mon_mgr_beacon_grace"));
 
   // Populate any missing beacons (i.e. no beacon since MgrMonitor
   // instantiation) with the current time, so that they will
@@ -533,7 +535,7 @@ void MgrMonitor::tick()
     if (promote_standby()) {
       dout(4) << "Promoted standby " << pending_map.active_gid << dendl;
       mon->clog->info() << "Activating manager daemon "
-                        << pending_map.active_name;
+                      << pending_map.active_name;
       propose = true;
     }
   }
@@ -541,8 +543,9 @@ void MgrMonitor::tick()
   if (!pending_map.available &&
       !ever_had_active_mgr &&
       should_warn_about_mgr_down() != HEALTH_OK) {
-    dout(10) << " exceeded mon_mgr_mkfs_grace " << g_conf->mon_mgr_mkfs_grace
-            << " seconds" << dendl;
+    dout(10) << " exceeded mon_mgr_mkfs_grace "
+             << g_conf->get_val<int64_t>("mon_mgr_mkfs_grace")
+             << " seconds" << dendl;
     propose = true;
   }
 
index fd962eba789e0f6993397d9dda45890f7ed1fc1b..18c38a34ef245d8f858c2aa29583c3ed93c2df10 100644 (file)
@@ -3010,8 +3010,8 @@ void Monitor::handle_command(MonOpRequestRef op)
       osdmon()->osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS) {
     const auto& hdr = m->get_header();
     uint64_t size = hdr.front_len + hdr.middle_len + hdr.data_len;
-    uint64_t max =
-      g_conf->mon_client_bytes * g_conf->mon_mgr_proxy_client_bytes_ratio;
+    uint64_t max = g_conf->get_val<uint64_t>("mon_client_bytes")
+                 * g_conf->get_val<double>("mon_mgr_proxy_client_bytes_ratio");
     if (mgr_proxy_bytes + size > max) {
       dout(10) << __func__ << " current mgr proxy bytes " << mgr_proxy_bytes
               << " + " << size << " > max " << max << dendl;