return 0;
}),
- Option("rbd_op_threads", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_op_threads", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1)
.set_description("number of threads to utilize for internal processing"),
- Option("rbd_op_thread_timeout", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_op_thread_timeout", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(60)
.set_description("time in seconds for detecting a hung thread"),
.set_default(1.0)
.set_description("seconds in cache before writeback starts"),
- Option("rbd_cache_max_dirty_object", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_cache_max_dirty_object", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("dirty limit for objects - set to 0 for auto calculate from rbd_cache_size"),
.set_default(false)
.set_description("whether to block writes to the cache before the aio_write call completes"),
- Option("rbd_concurrent_management_ops", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_concurrent_management_ops", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(10)
.set_min(1)
.set_description("how many operations can be in flight for a management operation like deleting or resizing an image"),
"object size will disable sparse-read for all "
"requests"),
- Option("rbd_readahead_trigger_requests", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_readahead_trigger_requests", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(10)
.set_description("number of sequential requests necessary to trigger readahead"),
.set_default(true)
.set_description("whether to blacklist clients whose lock was broken"),
- Option("rbd_blacklist_expire_seconds", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_blacklist_expire_seconds", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("number of seconds to blacklist - set to 0 for OSD default"),
- Option("rbd_request_timed_out_seconds", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_request_timed_out_seconds", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(30)
.set_description("number of seconds before maintenance request times out"),
.set_default(0)
.set_description("time-delay in seconds for rbd-mirror delete propagation"),
- Option("rbd_mirroring_replay_delay", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirroring_replay_delay", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("time-delay in seconds for rbd-mirror asynchronous replication"),
- Option("rbd_default_format", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_default_format", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(2)
.set_description("default image format for new images"),
- Option("rbd_default_order", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_default_order", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(22)
.set_description("default order (data block object size) for new images"),
.set_default(5)
.set_description("commit time interval, seconds"),
- Option("rbd_journal_object_flush_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_journal_object_flush_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("maximum number of pending commits per journal object"),
.set_default(16384)
.set_description("maximum journal payload size before splitting"),
- Option("rbd_journal_max_concurrent_object_sets", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_journal_max_concurrent_object_sets", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("maximum number of object sets a journal client can be behind before it is automatically unregistered"),
.set_default(5)
.set_description("maximum number of image syncs in parallel"),
- Option("rbd_mirror_pool_replayers_refresh_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirror_pool_replayers_refresh_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(30)
.set_description("interval to refresh peers in rbd-mirror daemon"),
.set_default(30)
.set_description("interval to check and retry the failed deletion requests"),
- Option("rbd_mirror_image_state_check_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirror_image_state_check_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(30)
.set_min(1)
.set_description("interval to get images from pool watcher and set sources in replayer"),
- Option("rbd_mirror_leader_heartbeat_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirror_leader_heartbeat_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(5)
.set_min(1)
.set_description("interval (in seconds) between mirror leader heartbeats"),
- Option("rbd_mirror_leader_max_missed_heartbeats", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirror_leader_max_missed_heartbeats", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(2)
.set_description("number of missed heartbeats for non-lock owner to attempt to acquire lock"),
- Option("rbd_mirror_leader_max_acquire_attempts_before_break", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirror_leader_max_acquire_attempts_before_break", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(3)
.set_description("number of failed attempts to acquire lock after missing heartbeats before breaking lock"),
.set_enum_allowed({"none", "simple"})
.set_description("active/active policy type for mapping images to instances"),
- Option("rbd_mirror_image_policy_migration_throttle", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("rbd_mirror_image_policy_migration_throttle", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(300)
.set_description("number of seconds after which an image can be reshuffled (migrated) again"),
: ThreadPool(cct, "librbd::thread_pool", "tp_librbd", 1,
"rbd_op_threads"),
op_work_queue(new ContextWQ("librbd::op_work_queue",
- cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+ cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
this)) {
start();
}
get_thread_pool_instance(cct, &thread_pool, &op_work_queue);
io_work_queue = new io::ImageRequestWQ<>(
this, "librbd::io_work_queue",
- cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+ cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
thread_pool);
io_object_dispatcher = new io::ObjectDispatcher<>(this);
ASSIGN_OPTION(cache_max_dirty, Option::size_t);
ASSIGN_OPTION(cache_target_dirty, Option::size_t);
ASSIGN_OPTION(cache_max_dirty_age, double);
- ASSIGN_OPTION(cache_max_dirty_object, int64_t);
+ ASSIGN_OPTION(cache_max_dirty_object, uint64_t);
ASSIGN_OPTION(cache_block_writes_upfront, bool);
- ASSIGN_OPTION(concurrent_management_ops, int64_t);
+ ASSIGN_OPTION(concurrent_management_ops, uint64_t);
ASSIGN_OPTION(balance_snap_reads, bool);
ASSIGN_OPTION(localize_snap_reads, bool);
ASSIGN_OPTION(balance_parent_reads, bool);
ASSIGN_OPTION(localize_parent_reads, bool);
ASSIGN_OPTION(sparse_read_threshold_bytes, Option::size_t);
- ASSIGN_OPTION(readahead_trigger_requests, int64_t);
+ ASSIGN_OPTION(readahead_trigger_requests, uint64_t);
ASSIGN_OPTION(readahead_max_bytes, Option::size_t);
ASSIGN_OPTION(readahead_disable_after_bytes, Option::size_t);
ASSIGN_OPTION(clone_copy_on_read, bool);
ASSIGN_OPTION(blacklist_on_break_lock, bool);
- ASSIGN_OPTION(blacklist_expire_seconds, int64_t);
- ASSIGN_OPTION(request_timed_out_seconds, int64_t);
+ ASSIGN_OPTION(blacklist_expire_seconds, uint64_t);
+ ASSIGN_OPTION(request_timed_out_seconds, uint64_t);
ASSIGN_OPTION(enable_alloc_hint, bool);
ASSIGN_OPTION(journal_order, uint64_t);
ASSIGN_OPTION(journal_splay_width, uint64_t);
ASSIGN_OPTION(journal_commit_age, double);
- ASSIGN_OPTION(journal_object_flush_interval, int64_t);
+ ASSIGN_OPTION(journal_object_flush_interval, uint64_t);
ASSIGN_OPTION(journal_object_flush_bytes, Option::size_t);
ASSIGN_OPTION(journal_object_flush_age, double);
ASSIGN_OPTION(journal_object_max_in_flight_appends, uint64_t);
ASSIGN_OPTION(journal_max_payload_bytes, Option::size_t);
- ASSIGN_OPTION(journal_max_concurrent_object_sets, int64_t);
+ ASSIGN_OPTION(journal_max_concurrent_object_sets, uint64_t);
ASSIGN_OPTION(mirroring_resync_after_disconnect, bool);
ASSIGN_OPTION(mirroring_delete_delay, uint64_t);
- ASSIGN_OPTION(mirroring_replay_delay, int64_t);
+ ASSIGN_OPTION(mirroring_replay_delay, uint64_t);
ASSIGN_OPTION(mtime_update_interval, uint64_t);
ASSIGN_OPTION(atime_update_interval, uint64_t);
ASSIGN_OPTION(skip_partial_discard, bool);
ThreadPoolSingleton>("librbd::ImageUpdateWatchers::thread_pool",
false, m_cct);
m_work_queue = new ContextWQ("librbd::ImageUpdateWatchers::op_work_queue",
- m_cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+ m_cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
&thread_pool);
}
&cct->lookup_or_create_singleton_object<ThreadPoolSingleton>(
"librbd::journal::thread_pool", false, cct);
m_work_queue = new ContextWQ("librbd::journal::work_queue",
- cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+ cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
thread_pool_singleton);
ImageCtx::get_timer_instance(cct, &m_timer, &m_timer_lock);
}
bool complete;
{
Mutex::Locker locker(m_lock);
- for (int i = 0;
- i < m_cct->_conf.get_val<int64_t>("rbd_concurrent_management_ops");
+ for (uint64_t i = 0;
+ i < m_cct->_conf.get_val<uint64_t>("rbd_concurrent_management_ops");
++i) {
send_next_object_copy();
if (m_ret_val < 0 && m_current_ops == 0) {
}
if (get_image_option(m_image_options, RBD_IMAGE_OPTION_ORDER,
&m_order) != 0 || m_order == 0) {
- m_order = config.get_val<int64_t>("rbd_default_order");
+ m_order = config.get_val<uint64_t>("rbd_default_order");
}
if (get_image_option(m_image_options, RBD_IMAGE_OPTION_JOURNAL_ORDER,
&m_journal_order) != 0) {
uint64_t format;
if (opts.get(RBD_IMAGE_OPTION_FORMAT, &format) != 0)
- format = cct->_conf.get_val<int64_t>("rbd_default_format");
+ format = cct->_conf.get_val<uint64_t>("rbd_default_format");
bool old_format = format == 1;
// make sure it doesn't already exist, in either format
uint64_t order = 0;
if (opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0 || order == 0) {
- order = cct->_conf.get_val<int64_t>("rbd_default_order");
+ order = cct->_conf.get_val<uint64_t>("rbd_default_order");
}
r = image::CreateRequest<>::validate_order(cct, order);
if (r < 0) {
CephContext *cct = reinterpret_cast<CephContext *>(ioctx.cct());
EXPECT_EQ(cct->_conf.get_val<bool>("rbd_blacklist_on_break_lock"),
blacklist_locker);
- EXPECT_EQ(cct->_conf.get_val<int64_t>("rbd_blacklist_expire_seconds"),
- (int)blacklist_expire_seconds);
+ EXPECT_EQ(cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"),
+ blacklist_expire_seconds);
EXPECT_FALSE(force_break_lock);
ceph_assert(s_instance != nullptr);
s_instance->on_finish = on_finish;
EXPECT_EQ(0, _rados->conf_set("rbd_mirror_leader_max_missed_heartbeats",
"1"));
CephContext *cct = reinterpret_cast<CephContext *>(m_local_io_ctx.cct());
- int max_acquire_attempts = cct->_conf.get_val<int64_t>(
+ int max_acquire_attempts = cct->_conf.get_val<uint64_t>(
"rbd_mirror_leader_max_acquire_attempts_before_break");
MockManagedLock mock_managed_lock;
ceph_assert(r >= 0);
uint64_t order;
if (info.order == 0) {
- order = g_conf().get_val<int64_t>("rbd_default_order");
+ order = g_conf().get_val<uint64_t>("rbd_default_order");
} else {
order = info.order;
}
chunk_size = image->get_stripe_unit();
}
- concurr = g_conf().get_val<int64_t>("rbd_concurrent_management_ops");
+ concurr = g_conf().get_val<uint64_t>("rbd_concurrent_management_ops");
io_status.in_flight = 0;
io_status.io_error = 0;
}
}
}
ExportDiffContext edc(&image, fd, info.size,
- g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+ g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
no_progress, export_format);
r = image.diff_iterate2(fromsnapname, 0, info.size, true, whole_object,
&C_ExportDiff::export_diff_cb, (void *)&edc);
fd = STDOUT_FILENO;
max_concurrent_ops = 1;
} else {
- max_concurrent_ops = g_conf().get_val<int64_t>("rbd_concurrent_management_ops");
+ max_concurrent_ops = g_conf().get_val<uint64_t>("rbd_concurrent_management_ops");
fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0644);
if (fd < 0) {
return -errno;
ImportDiffContext(librbd::Image *image, int fd, size_t size, bool no_progress)
: image(image), fd(fd), size(size), pc("Importing image diff", no_progress),
throttle((fd == STDIN_FILENO) ? 1 :
- g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+ g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
false),
last_offset(0) {
}
throttle.reset(new SimpleThrottle(1, false));
} else {
throttle.reset(new SimpleThrottle(
- g_conf().get_val<int64_t>("rbd_concurrent_management_ops"), false));
+ g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"), false));
}
reqlen = min<uint64_t>(reqlen, size);
uint64_t order;
if (opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0) {
- order = g_conf().get_val<int64_t>("rbd_default_order");
+ order = g_conf().get_val<uint64_t>("rbd_default_order");
}
// try to fill whole imgblklen blocks for sparsification
}
r = do_list(pool_name, namespace_name, vm["long"].as<bool>(),
- g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+ g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
formatter.get());
if (r < 0) {
std::cerr << "rbd: listing images failed : " << cpp_strerror(r) << std::endl;
m_factory(std::bind(ImageRequestAllocator<RequestT>(),
std::ref(m_io_ctx), std::ref(m_throttle),
std::placeholders::_1, std::forward<Args>(args)...)),
- m_throttle(g_conf().get_val<int64_t>("rbd_concurrent_management_ops"),
+ m_throttle(g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
true) {
}
});
auto cct = static_cast<CephContext *>(m_local_rados->cct());
- int after = cct->_conf.get_val<int64_t>(
+ int after = cct->_conf.get_val<uint64_t>(
"rbd_mirror_image_state_check_interval");
dout(10) << "scheduling image state check after " << after << " sec (task "
m_lock(unique_lock_name("rbd::mirror::InstanceWatcher::m_lock", this)),
m_instance_lock(librbd::ManagedLock<I>::create(
m_ioctx, m_work_queue, m_oid, this, librbd::managed_lock::EXCLUSIVE, true,
- m_cct->_conf.get_val<int64_t>("rbd_blacklist_expire_seconds"))) {
+ m_cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"))) {
}
template <typename I>
return;
}
- int after = m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_heartbeat_interval") *
- (1 + m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_max_missed_heartbeats") +
- m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_max_acquire_attempts_before_break"));
+ int after = m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_heartbeat_interval") *
+ (1 + m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_max_missed_heartbeats") +
+ m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_max_acquire_attempts_before_break"));
bool schedule = false;
utime_t oldest_time = time;
m_notifier_id(librados::Rados(io_ctx).get_instance_id()),
m_instance_id(stringify(m_notifier_id)),
m_leader_lock(new LeaderLock(m_ioctx, m_work_queue, m_oid, this, true,
- m_cct->_conf.get_val<int64_t>(
+ m_cct->_conf.get_val<uint64_t>(
"rbd_blacklist_expire_seconds"))) {
}
m_timer_gate->timer_callback = timer_callback;
});
- int after = delay_factor * m_cct->_conf.get_val<int64_t>(
+ int after = delay_factor * m_cct->_conf.get_val<uint64_t>(
"rbd_mirror_leader_heartbeat_interval");
dout(10) << "scheduling " << name << " after " << after << " sec (task "
}
}
- if (m_acquire_attempts >= m_cct->_conf.get_val<int64_t>(
+ if (m_acquire_attempts >= m_cct->_conf.get_val<uint64_t>(
"rbd_mirror_leader_max_acquire_attempts_before_break")) {
dout(0) << "breaking leader lock after " << m_acquire_attempts << " "
<< "failed attempts to acquire" << dendl;
schedule_timer_task("acquire leader lock",
delay_factor *
- m_cct->_conf.get_val<int64_t>("rbd_mirror_leader_max_missed_heartbeats"),
+ m_cct->_conf.get_val<uint64_t>("rbd_mirror_leader_max_missed_heartbeats"),
false, &LeaderWatcher<I>::acquire_leader_lock, false);
}
LeaderLock *m_leader_lock;
Context *m_on_finish = nullptr;
Context *m_on_shut_down_finish = nullptr;
- int m_acquire_attempts = 0;
+ uint64_t m_acquire_attempts = 0;
int m_ret_val = 0;
MirrorStatusWatcher<ImageCtxT> *m_status_watcher = nullptr;
Instances<ImageCtxT> *m_instances = nullptr;
}
m_cond.WaitInterval(
m_lock,
- utime_t(m_cct->_conf.get_val<int64_t>("rbd_mirror_pool_replayers_refresh_interval"), 0));
+ utime_t(m_cct->_conf.get_val<uint64_t>("rbd_mirror_pool_replayers_refresh_interval"), 0));
}
// stop all pool replayers in parallel
template <typename I>
Threads<I>::Threads(CephContext *cct) : timer_lock("Threads::timer_lock") {
thread_pool = new ThreadPool(cct, "Journaler::thread_pool", "tp_journal",
- cct->_conf.get_val<int64_t>("rbd_op_threads"),
+ cct->_conf.get_val<uint64_t>("rbd_op_threads"),
"rbd_op_threads");
thread_pool->start();
work_queue = new ContextWQ("Journaler::work_queue",
- cct->_conf.get_val<int64_t>("rbd_op_thread_timeout"),
+ cct->_conf.get_val<uint64_t>("rbd_op_thread_timeout"),
thread_pool);
timer = new SafeTimer(cct, timer_lock, true);
ceph_assert(m_map_lock.is_locked());
CephContext *cct = reinterpret_cast<CephContext *>(m_ioctx.cct());
- int migration_throttle = cct->_conf.get_val<int64_t>(
+ int migration_throttle = cct->_conf.get_val<uint64_t>(
"rbd_mirror_image_policy_migration_throttle");
auto it = m_image_states.find(global_image_id);