]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: update osd_beacon_report_interval on conf change 54437/head
authorMatan Breizman <mbreizma@redhat.com>
Thu, 23 Nov 2023 15:15:58 +0000 (15:15 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 29 Nov 2023 09:24:06 +0000 (09:24 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd.cc
src/crimson/osd/osd.h

index 1b574abd8fa386239a9ee4a369aa3baa5d90e753..f3648c6df277065e585480d16a19ab64ea5391f0 100644 (file)
@@ -868,6 +868,25 @@ void OSD::handle_authentication(const EntityName& name,
   }
 }
 
+const char** OSD::get_tracked_conf_keys() const
+{
+  static const char* KEYS[] = {
+    "osd_beacon_report_interval",
+    nullptr
+  };
+  return KEYS;
+}
+
+void OSD::handle_conf_change(
+  const crimson::common::ConfigProxy& conf,
+  const std::set <std::string> &changed)
+{
+  if (changed.count("osd_beacon_report_interval")) {
+    beacon_timer.rearm_periodic(
+      std::chrono::seconds(conf->osd_beacon_report_interval));
+  }
+}
+
 void OSD::update_stats()
 {
   osd_stat_seq++;
index 8125e89fbaf1c6468413cf50b4541f4bf44709c8..134376ad947ee03a12b92e7bcdf916383c666a6a 100644 (file)
@@ -61,7 +61,8 @@ class PG;
 
 class OSD final : public crimson::net::Dispatcher,
                  private crimson::common::AuthHandler,
-                 private crimson::mgr::WithStats {
+                 private crimson::mgr::WithStats,
+                 public md_config_obs_t {
   const int whoami;
   const uint32_t nonce;
   seastar::abort_source& abort_source;
@@ -126,6 +127,10 @@ class OSD final : public crimson::net::Dispatcher,
   std::unique_ptr<Heartbeat> heartbeat;
   seastar::timer<seastar::lowres_clock> tick_timer;
 
+  const char** get_tracked_conf_keys() const final;
+  void handle_conf_change(const ConfigProxy& conf,
+                          const std::set<std::string> &changed) final;
+
   // admin-socket
   seastar::lw_shared_ptr<crimson::admin::AdminSocket> asok;