Skip to content

Commit

Permalink
Merge pull request ceph#24450 from dillaman/wip-rbd-conf-keys
Browse files Browse the repository at this point in the history
librbd: simplify config override handling

Reviewed-by: Mykola Golub <[email protected]>
  • Loading branch information
trociny authored Oct 10, 2018
2 parents c98bbf4 + 03faf68 commit 5c5c024
Show file tree
Hide file tree
Showing 61 changed files with 465 additions and 659 deletions.
3 changes: 3 additions & 0 deletions src/common/config_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class ConfigProxy {
void config_options(Formatter *f) const {
config.config_options(f);
}
const decltype(md_config_t::schema)& get_schema() const {
return config.schema;
}
const Option* get_schema(const std::string& key) const {
auto found = config.schema.find(key);
if (found == config.schema.end()) {
Expand Down
36 changes: 18 additions & 18 deletions src/common/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6420,11 +6420,11 @@ static std::vector<Option> get_rbd_options() {
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"),

Expand Down Expand Up @@ -6458,15 +6458,15 @@ static std::vector<Option> get_rbd_options() {
.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"),

Option("rbd_cache_block_writes_upfront", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.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"),
Expand Down Expand Up @@ -6499,7 +6499,7 @@ static std::vector<Option> get_rbd_options() {
"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"),

Expand All @@ -6519,11 +6519,11 @@ static std::vector<Option> get_rbd_options() {
.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"),

Expand Down Expand Up @@ -6563,15 +6563,15 @@ static std::vector<Option> get_rbd_options() {
.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"),

Expand Down Expand Up @@ -6616,7 +6616,7 @@ static std::vector<Option> get_rbd_options() {
.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"),

Expand All @@ -6640,7 +6640,7 @@ static std::vector<Option> get_rbd_options() {
.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"),

Expand Down Expand Up @@ -6706,7 +6706,7 @@ static std::vector<Option> get_rbd_mirror_options() {
.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"),

Expand All @@ -6719,21 +6719,21 @@ static std::vector<Option> get_rbd_mirror_options() {
.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"),

Expand All @@ -6742,7 +6742,7 @@ static std::vector<Option> get_rbd_mirror_options() {
.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"),

Expand Down
4 changes: 2 additions & 2 deletions src/librbd/ExclusiveLock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ template <typename I>
ExclusiveLock<I>::ExclusiveLock(I &image_ctx)
: ML<I>(image_ctx.md_ctx, image_ctx.op_work_queue, image_ctx.header_oid,
image_ctx.image_watcher, managed_lock::EXCLUSIVE,
image_ctx.blacklist_on_break_lock,
image_ctx.blacklist_expire_seconds),
image_ctx.config.template get_val<bool>("rbd_blacklist_on_break_lock"),
image_ctx.config.template get_val<uint64_t>("rbd_blacklist_expire_seconds")),
m_image_ctx(image_ctx) {
Mutex::Locker locker(ML<I>::m_lock);
ML<I>::set_state_uninitialized();
Expand Down
Loading

0 comments on commit 5c5c024

Please sign in to comment.