]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: configuration options to control replay throttling
authorJason Dillaman <dillaman@redhat.com>
Tue, 19 Jul 2016 04:50:14 +0000 (00:50 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 17 Aug 2016 17:22:06 +0000 (13:22 -0400)
Fixes: http://tracker.ceph.com/issues/16223
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 24883e0605907d1f9bcd1206c8a95c3bde30d5dc)

src/common/config_opts.h
src/test/rbd_mirror/test_ImageReplayer.cc
src/tools/rbd_mirror/ImageReplayer.cc

index 851f7c88e2827694edef1908dab442d011a53bdd..1a033d95ca9225e2e35e959440e83751056d934a 100644 (file)
@@ -1215,6 +1215,9 @@ OPTION(rbd_journal_max_payload_bytes, OPT_U32, 16384) // maximum journal payload
 /**
  * RBD Mirror options
  */
+OPTION(rbd_mirror_journal_commit_age, OPT_DOUBLE, 5) // commit time interval, seconds
+OPTION(rbd_mirror_journal_poll_age, OPT_DOUBLE, 5) // maximum age (in seconds) between successive journal polls
+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
 
index 9285d71da568d5b7abf9492e87c40e285b2d9637..fd50c771e101ad2ee7a563252a4813e932e385b9 100644 (file)
@@ -78,6 +78,7 @@ public:
   {
     EXPECT_EQ("", connect_cluster_pp(*m_local_cluster.get()));
     EXPECT_EQ(0, m_local_cluster->conf_set("rbd_cache", "false"));
+    EXPECT_EQ(0, m_local_cluster->conf_set("rbd_mirror_journal_poll_age", "1"));
 
     m_local_pool_name = get_temp_pool_name();
     EXPECT_EQ(0, m_local_cluster->pool_create(m_local_pool_name.c_str()));
index 9bdca879225e4a8ca6b3ff5e4214607c7e844f07..bc61a48282a891096a7e7e3d70dc04b817fbd136 100644 (file)
@@ -380,7 +380,8 @@ void ImageReplayer<I>::start(Context *on_finish,
 
   CephContext *cct = static_cast<CephContext *>(m_local->cct());
   journal::Settings settings;
-  settings.commit_interval = cct->_conf->rbd_journal_commit_age;
+  settings.commit_interval = cct->_conf->rbd_mirror_journal_commit_age;
+  settings.max_fetch_bytes = cct->_conf->rbd_mirror_journal_max_fetch_bytes;
 
   m_remote_journaler = new Journaler(m_threads->work_queue,
                                      m_threads->timer,
@@ -571,10 +572,12 @@ void ImageReplayer<I>::handle_start_replay(int r) {
   }
 
   {
+    CephContext *cct = static_cast<CephContext *>(m_local->cct());
+    double poll_seconds = cct->_conf->rbd_mirror_journal_poll_age;
+
     Mutex::Locker locker(m_lock);
     m_replay_handler = new ReplayHandler<I>(this);
-    m_remote_journaler->start_live_replay(m_replay_handler,
-                                          1 /* TODO: configurable */);
+    m_remote_journaler->start_live_replay(m_replay_handler, poll_seconds);
 
     dout(20) << "m_remote_journaler=" << *m_remote_journaler << dendl;
   }