]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd-mirror: configuration overrides for hard coded timers
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Wed, 9 Nov 2016 00:39:10 +0000 (19:39 -0500)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Mon, 14 Nov 2016 14:41:41 +0000 (09:41 -0500)
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
src/common/config_opts.h
src/tools/rbd_mirror/ImageDeleter.cc
src/tools/rbd_mirror/ImageDeleter.h
src/tools/rbd_mirror/Mirror.cc
src/tools/rbd_mirror/Replayer.cc

index fbbb1228bd27f90173766a0ad440ee2ef1d92e96..5b669487958e26c8809494308f4e823262bc32b5 100644 (file)
@@ -1319,6 +1319,10 @@ OPTION(rbd_mirror_journal_poll_age, OPT_DOUBLE, 5) // maximum age (in seconds) b
 OPTION(rbd_mirror_journal_max_fetch_bytes, OPT_U32, 32768) // maximum bytes to read from each journal data object per fetch
 OPTION(rbd_mirror_sync_point_update_age, OPT_DOUBLE, 30) // number of seconds between each update of the image sync point object number
 OPTION(rbd_mirror_concurrent_image_syncs, OPT_U32, 5) // maximum number of image syncs in parallel
+OPTION(rbd_mirror_pool_replayers_refresh_interval, OPT_INT, 30) // interval to refresh peers in rbd-mirror daemon
+OPTION(rbd_mirror_delete_retry_interval, OPT_DOUBLE, 30) // interval to check and retry the failed requests in deleter
+OPTION(rbd_mirror_image_directory_refresh_interval, OPT_INT, 30) // interval to refresh images in pool watcher
+OPTION(rbd_mirror_image_state_check_interval, OPT_INT, 30) // interval to get images from pool watcher and set sources in replayer
 
 OPTION(nss_db_path, OPT_STR, "") // path to nss db
 
index 0b0c775dba0d133f0d852a94ada066f2db58ea9e..d879368e3c2cd837cdaa0587242074897af4ba30 100644 (file)
@@ -141,6 +141,7 @@ ImageDeleter::ImageDeleter(ContextWQ *work_queue, SafeTimer *timer,
     m_failed_timer_lock(timer_lock),
     m_asok_hook(new ImageDeleterAdminSocketHook(g_ceph_context, this))
 {
+  set_failed_timer_interval(g_ceph_context->_conf->rbd_mirror_delete_retry_interval);
   m_image_deleter_thread.create("image_deleter");
 }
 
index d9b0f2e74340522ca2f936c9c452d71a5bd4b9c3..32d1c66345b925d37c7332424d7620b050b0f982 100644 (file)
@@ -119,8 +119,7 @@ private:
   ImageDeleterThread m_image_deleter_thread;
 
   std::deque<std::unique_ptr<DeleteInfo>> m_failed_queue;
-  // TODO: make interval value configurable
-  double m_failed_interval = 30;
+  double m_failed_interval;
   SafeTimer *m_failed_timer;
   Mutex *m_failed_timer_lock;
 
index d3aba0c63be240a83516e8cd39c1835eb12d98be..8d5b83a08ae53f53be4a8168172b1c268c3f98c1 100644 (file)
@@ -16,7 +16,6 @@
 #define dout_prefix *_dout << "rbd::mirror::Mirror: " << this << " " \
                            << __func__ << ": "
 
-using std::chrono::seconds;
 using std::list;
 using std::map;
 using std::set;
@@ -235,8 +234,8 @@ void Mirror::run()
     if (!m_manual_stop) {
       update_replayers(m_local_cluster_watcher->get_pool_peers());
     }
-    // TODO: make interval configurable
-    m_cond.WaitInterval(g_ceph_context, m_lock, seconds(30));
+    m_cond.WaitInterval(g_ceph_context, m_lock,
+       utime_t(m_cct->_conf->rbd_mirror_pool_replayers_refresh_interval, 0));
   }
 
   // stop all replayers in parallel
index f3ccca9b35b2a8fb068d737fff809d19519b4f74..78c2091e9e80bcbd4cb8409a8498a1dc010c7b65 100644 (file)
@@ -303,8 +303,9 @@ int Replayer::init()
   // Bootstrap existing mirroring images
   init_local_mirroring_images();
 
-  // TODO: make interval configurable
-  m_pool_watcher.reset(new PoolWatcher(m_remote_io_ctx, 30, m_lock, m_cond));
+  m_pool_watcher.reset(new PoolWatcher(m_remote_io_ctx,
+                      g_ceph_context->_conf->rbd_mirror_image_directory_refresh_interval,
+                      m_lock, m_cond));
   m_pool_watcher->refresh_images();
 
   m_replayer_thread.create("replayer");
@@ -456,7 +457,8 @@ void Replayer::run()
     if (m_blacklisted) {
       break;
     }
-    m_cond.WaitInterval(g_ceph_context, m_lock, seconds(30));
+    m_cond.WaitInterval(g_ceph_context, m_lock,
+       utime_t(g_ceph_context->_conf->rbd_mirror_image_state_check_interval, 0));
   }
 
   ImageIds empty_sources;