]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add mono_timer
authorSage Weil <sage@redhat.com>
Fri, 19 Jul 2019 20:59:10 +0000 (15:59 -0500)
committerSage Weil <sage@redhat.com>
Thu, 26 Sep 2019 17:21:53 +0000 (12:21 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 96aed0b706e308d3a9e8776f0f7538f3abed4786..6f5ca81ba0ae0f65cbc8785a1d55a75f33c3cf20 100644 (file)
@@ -481,6 +481,8 @@ void OSDService::shutdown_reserver()
 
 void OSDService::shutdown()
 {
+  mono_timer.suspend();
+
   {
     std::lock_guard l(watch_lock);
     watch_timer.shutdown();
@@ -509,6 +511,7 @@ void OSDService::init()
 
   watch_timer.init();
   agent_timer.init();
+  mono_timer.resume();
 
   agent_thread.create("osd_srv_agent");
 
index ae2fafd201fba7d85d1c1c2fb5cf625ef158fd59..3d7c70e68455a1a1a8210bebab5a5541a040faae 100644 (file)
@@ -25,6 +25,7 @@
 #include "common/ceph_context.h"
 #include "common/config_cacher.h"
 #include "common/zipkin_trace.h"
+#include "common/ceph_timer.h"
 
 #include "mgr/MgrClient.h"
 
@@ -857,6 +858,10 @@ public:
   /// get or create a ref for a peer's HeartbeatStamps
   HeartbeatStampsRef get_hb_stamps(unsigned osd);
 
+
+  // Timer for readable leases
+  ceph::timer<ceph::mono_clock> mono_timer = ceph::timer<ceph::mono_clock>{ceph::construct_suspended};
+
   // -- stopping --
   ceph::mutex is_stopping_lock = ceph::make_mutex("OSDService::is_stopping_lock");
   ceph::condition_variable is_stopping_cond;