From bca85e714eab490fdfa6ec6796c7c7ea46b31651 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Tue, 21 May 2024 14:00:28 +0800 Subject: [PATCH] crimson/osd: move stats_timer after store is mounted To report stats after the store is initialized. Signed-off-by: Yingxin Cheng (cherry picked from commit f183adb469ceb647fd2c2dad25d10adbc891b711) --- src/crimson/osd/osd.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 0a40a7158f8a7..6bdda0a8cf929 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -384,6 +384,16 @@ seastar::future<> OSD::start() std::ref(store), std::ref(osd_states)); }); + }).then([this, FNAME] { + heartbeat.reset(new Heartbeat{ + whoami, get_shard_services(), + *monc, *hb_front_msgr, *hb_back_msgr}); + return store.mount().handle_error( + crimson::stateful_ec::assert_failure([FNAME] (const auto& ec) { + ERROR("error mounting object store in {}: ({}) {}", + local_conf().get_val("osd_data"), + ec.value(), ec.message()); + })); }).then([this, FNAME] { auto stats_seconds = local_conf().get_val("crimson_osd_stat_interval"); if (stats_seconds > 0) { @@ -407,16 +417,6 @@ seastar::future<> OSD::start() stats_timer.arm_periodic(std::chrono::seconds(stats_seconds)); } - heartbeat.reset(new Heartbeat{ - whoami, get_shard_services(), - *monc, *hb_front_msgr, *hb_back_msgr}); - return store.mount().handle_error( - crimson::stateful_ec::assert_failure([FNAME] (const auto& ec) { - ERROR("error mounting object store in {}: ({}) {}", - local_conf().get_val("osd_data"), - ec.value(), ec.message()); - })); - }).then([this] { return open_meta_coll(); }).then([this] { return pg_shard_manager.get_meta_coll().load_superblock( -- 2.39.5