Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbd-mirror: configuration overrides for hard coded timers #11840

Merged
merged 2 commits into from Nov 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/config_opts.h
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/tools/rbd_mirror/ImageDeleter.cc
Expand Up @@ -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");
}

Expand Down
3 changes: 1 addition & 2 deletions src/tools/rbd_mirror/ImageDeleter.h
Expand Up @@ -119,8 +119,7 @@ class ImageDeleter {
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;

Expand Down
6 changes: 2 additions & 4 deletions src/tools/rbd_mirror/Mirror.cc
Expand Up @@ -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;
Expand Down Expand Up @@ -215,7 +214,6 @@ int Mirror::init()
return r;
}

// TODO: make interval configurable
m_local_cluster_watcher.reset(new ClusterWatcher(m_local, m_lock));

m_image_deleter.reset(new ImageDeleter(m_threads->work_queue,
Expand All @@ -236,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
Expand Down
8 changes: 5 additions & 3 deletions src/tools/rbd_mirror/Replayer.cc
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down