]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: implement ShardServices::get_hb_stamps()
authorKefu Chai <kchai@redhat.com>
Mon, 30 Sep 2019 08:20:37 +0000 (16:20 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 30 Sep 2019 08:25:02 +0000 (16:25 +0800)
PeeringState::proc_lease() requires a valid hb_stamps[0], which is in
turned maintained by `pl`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/shard_services.cc
src/crimson/osd/shard_services.h

index e41b77ac27a0c198c12d7678a10d6d628abb9b3f..f727c66ca24a6b34b43a026200958e4c1c2a1656 100644 (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;
 }
 
 };
index d9a2112b6b23c0ef4f33eabe8ed21cdde51306cb..407fa8a3643412c6a1c3212e97fcb0feba8bf5d5 100644 (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;
 };