Skip to content

Commit 9a58b2e

Browse files
committed
crimson/osd: update osd_beacon_report_interval on conf change
Signed-off-by: Matan Breizman <[email protected]>
1 parent 633e6b2 commit 9a58b2e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/crimson/osd/osd.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,25 @@ void OSD::handle_authentication(const EntityName& name,
868868
}
869869
}
870870

871+
const char** OSD::get_tracked_conf_keys() const
872+
{
873+
static const char* KEYS[] = {
874+
"osd_beacon_report_interval",
875+
nullptr
876+
};
877+
return KEYS;
878+
}
879+
880+
void OSD::handle_conf_change(
881+
const crimson::common::ConfigProxy& conf,
882+
const std::set <std::string> &changed)
883+
{
884+
if (changed.count("osd_beacon_report_interval")) {
885+
beacon_timer.rearm_periodic(
886+
std::chrono::seconds(conf->osd_beacon_report_interval));
887+
}
888+
}
889+
871890
void OSD::update_stats()
872891
{
873892
osd_stat_seq++;

src/crimson/osd/osd.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ class PG;
6161

6262
class OSD final : public crimson::net::Dispatcher,
6363
private crimson::common::AuthHandler,
64-
private crimson::mgr::WithStats {
64+
private crimson::mgr::WithStats,
65+
public md_config_obs_t {
6566
const int whoami;
6667
const uint32_t nonce;
6768
seastar::abort_source& abort_source;
@@ -126,6 +127,10 @@ class OSD final : public crimson::net::Dispatcher,
126127
std::unique_ptr<Heartbeat> heartbeat;
127128
seastar::timer<seastar::lowres_clock> tick_timer;
128129

130+
const char** get_tracked_conf_keys() const final;
131+
void handle_conf_change(const ConfigProxy& conf,
132+
const std::set<std::string> &changed) final;
133+
129134
// admin-socket
130135
seastar::lw_shared_ptr<crimson::admin::AdminSocket> asok;
131136

0 commit comments

Comments
 (0)