crimson/osd: implement ShardServices::get_hb_stamps()

PeeringState::proc_lease() requires a valid hb_stamps[0], which is in
turned maintained by `pl`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-09-30 16:20:37 +08:00
parent b031ecda44
commit 3138e195fa
2 changed files with 6 additions and 2 deletions

View File

@ -239,8 +239,11 @@ seastar::future<> ShardServices::osdmap_subscribe(version_t epoch, bool force_re
HeartbeatStampsRef ShardServices::get_hb_stamps(int peer)
{
#warning writeme
return HeartbeatStampsRef();
auto [stamps, added] = heartbeat_stamps.try_emplace(peer);
if (added) {
stamps->second = ceph::make_ref<HeartbeatStamps>(peer);
}
return stamps->second;
}
};

View File

@ -157,6 +157,7 @@ public:
return ceph::mono_clock::now() - startup_time;
}
HeartbeatStampsRef get_hb_stamps(int peer);
std::map<int, HeartbeatStampsRef> heartbeat_stamps;
};