From 9a58b2e63b7f12c54101314abb8d29d4f862b119 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Thu, 23 Nov 2023 15:15:58 +0000 Subject: [PATCH] crimson/osd: update osd_beacon_report_interval on conf change Signed-off-by: Matan Breizman --- src/crimson/osd/osd.cc | 19 +++++++++++++++++++ src/crimson/osd/osd.h | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 1b574abd8fa..f3648c6df27 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -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 &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++; diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index 8125e89fbaf..134376ad947 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -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; seastar::timer tick_timer; + const char** get_tracked_conf_keys() const final; + void handle_conf_change(const ConfigProxy& conf, + const std::set &changed) final; + // admin-socket seastar::lw_shared_ptr asok; -- 2.39.5