From 7dc82bc08cbfabd424dcd0b83ed618d28db5fe8e Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 1 Aug 2017 15:03:57 -0400 Subject: [PATCH] rbd: switched from legacy to new-style configuration options Fixes: http://tracker.ceph.com/issues/20737 Signed-off-by: Jason Dillaman --- src/common/legacy_config_opts.h | 104 -------------- src/common/options.cc | 136 ++++++++++-------- src/librbd/ImageCtx.cc | 82 +++++------ src/librbd/ImageCtx.h | 1 + src/librbd/ImageState.cc | 2 +- src/librbd/ImageWatcher.cc | 3 +- src/librbd/Journal.cc | 2 +- src/librbd/image/CreateRequest.cc | 16 +-- src/librbd/internal.cc | 10 +- src/librbd/io/ImageRequestWQ.cc | 12 +- src/librbd/operation/ObjectMapIterate.cc | 2 +- src/test/librbd/journal/test_Entries.cc | 4 +- src/test/librbd/journal/test_Replay.cc | 14 +- .../managed_lock/test_mock_AcquireRequest.cc | 5 +- src/test/librbd/mock/MockImageCtx.h | 4 +- src/test/librbd/test_internal.cc | 2 +- .../rbd_mirror/test_mock_LeaderWatcher.cc | 4 +- src/tools/rbd/Utils.cc | 4 +- src/tools/rbd/action/Export.cc | 6 +- src/tools/rbd/action/Import.cc | 8 +- src/tools/rbd/action/Kernel.cc | 3 +- src/tools/rbd/action/List.cc | 4 +- src/tools/rbd/action/MirrorPool.cc | 3 +- src/tools/rbd_mirror/ImageDeleter.cc | 3 +- src/tools/rbd_mirror/ImageReplayer.cc | 9 +- src/tools/rbd_mirror/ImageSyncThrottler.cc | 6 +- src/tools/rbd_mirror/InstanceReplayer.cc | 3 +- src/tools/rbd_mirror/InstanceWatcher.cc | 2 +- src/tools/rbd_mirror/Instances.cc | 6 +- src/tools/rbd_mirror/LeaderWatcher.cc | 12 +- src/tools/rbd_mirror/Mirror.cc | 2 +- src/tools/rbd_mirror/PoolReplayer.cc | 4 +- src/tools/rbd_mirror/Threads.cc | 6 +- .../rbd_mirror/image_sync/ImageCopyRequest.cc | 5 +- src/tools/rbd_nbd/rbd-nbd.cc | 2 +- 35 files changed, 215 insertions(+), 276 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 5c28e939207d8..7222ef6ca7ea7 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1305,110 +1305,6 @@ OPTION(rados_mon_op_timeout, OPT_DOUBLE) // how many seconds to wait for a respo OPTION(rados_osd_op_timeout, OPT_DOUBLE) // how many seconds to wait for a response from osds before returning an error from a rados operation. 0 means no limit. OPTION(rados_tracing, OPT_BOOL) // true if LTTng-UST tracepoints should be enabled -OPTION(rbd_op_threads, OPT_INT) -OPTION(rbd_op_thread_timeout, OPT_INT) -OPTION(rbd_non_blocking_aio, OPT_BOOL) // process AIO ops from a worker thread to prevent blocking -OPTION(rbd_cache, OPT_BOOL) // whether to enable caching (writeback unless rbd_cache_max_dirty is 0) -OPTION(rbd_cache_writethrough_until_flush, OPT_BOOL) // whether to make writeback caching writethrough until flush is called, to be sure the user of librbd will send flushs so that writeback is safe -OPTION(rbd_cache_size, OPT_LONGLONG) // cache size in bytes -OPTION(rbd_cache_max_dirty, OPT_LONGLONG) // dirty limit in bytes - set to 0 for write-through caching -OPTION(rbd_cache_target_dirty, OPT_LONGLONG) // target dirty limit in bytes -OPTION(rbd_cache_max_dirty_age, OPT_FLOAT) // seconds in cache before writeback starts -OPTION(rbd_cache_max_dirty_object, OPT_INT) // dirty limit for objects - set to 0 for auto calculate from rbd_cache_size -OPTION(rbd_cache_block_writes_upfront, OPT_BOOL) // whether to block writes to the cache before the aio_write call completes (true)) -OPTION(rbd_concurrent_management_ops, OPT_INT) // how many operations can be in flight for a management operation like deleting or resizing an image -OPTION(rbd_balance_snap_reads, OPT_BOOL) -OPTION(rbd_localize_snap_reads, OPT_BOOL) -OPTION(rbd_balance_parent_reads, OPT_BOOL) -OPTION(rbd_localize_parent_reads, OPT_BOOL) -OPTION(rbd_readahead_trigger_requests, OPT_INT) // number of sequential requests necessary to trigger readahead -OPTION(rbd_readahead_max_bytes, OPT_LONGLONG) // set to 0 to disable readahead -OPTION(rbd_readahead_disable_after_bytes, OPT_LONGLONG) // how many bytes are read in total before readahead is disabled -OPTION(rbd_clone_copy_on_read, OPT_BOOL) -OPTION(rbd_blacklist_on_break_lock, OPT_BOOL) // whether to blacklist clients whose lock was broken -OPTION(rbd_blacklist_expire_seconds, OPT_INT) // number of seconds to blacklist - set to 0 for OSD default -OPTION(rbd_request_timed_out_seconds, OPT_INT) // number of seconds before maint request times out -OPTION(rbd_skip_partial_discard, OPT_BOOL) // when trying to discard a range inside an object, set to true to skip zeroing the range. -OPTION(rbd_enable_alloc_hint, OPT_BOOL) // when writing a object, it will issue a hint to osd backend to indicate the expected size object need -OPTION(rbd_tracing, OPT_BOOL) // true if LTTng-UST tracepoints should be enabled -OPTION(rbd_blkin_trace_all, OPT_BOOL) // create a blkin trace for all RBD requests -OPTION(rbd_validate_pool, OPT_BOOL) // true if empty pools should be validated for RBD compatibility -OPTION(rbd_validate_names, OPT_BOOL) // true if image specs should be validated -OPTION(rbd_auto_exclusive_lock_until_manual_request, OPT_BOOL) // whether to automatically acquire/release exclusive lock until it is explicitly requested, i.e. before we know the user of librbd is properly using the lock API -OPTION(rbd_mirroring_resync_after_disconnect, OPT_BOOL) // automatically start image resync after mirroring is disconnected due to being laggy -OPTION(rbd_mirroring_replay_delay, OPT_INT) // time-delay in seconds for rbd-mirror asynchronous replication - -OPTION(rbd_default_pool, OPT_STR) // default pool for storing images - -/* - * The following options change the behavior for librbd's image creation methods that - * don't require all of the parameters. These are provided so that older programs - * can take advantage of newer features without being rewritten to use new versions - * of the image creation functions. - * - * rbd_create()/RBD::create() are affected by all of these options. - * - * rbd_create2()/RBD::create2() and rbd_clone()/RBD::clone() are affected by: - * - rbd_default_order - * - rbd_default_stripe_count - * - rbd_default_stripe_size - * - * rbd_create3()/RBD::create3() and rbd_clone2/RBD::clone2() are only - * affected by rbd_default_order. - */ -OPTION(rbd_default_format, OPT_INT) -OPTION(rbd_default_order, OPT_INT) -OPTION(rbd_default_stripe_count, OPT_U64) // changing requires stripingv2 feature -OPTION(rbd_default_stripe_unit, OPT_U64) // changing to non-object size requires stripingv2 feature -OPTION(rbd_default_data_pool, OPT_STR) // optional default pool for storing image data blocks - -/** - * RBD features are only applicable for v2 images. This setting accepts either - * an integer bitmask value or comma-delimited string of RBD feature names. - * This setting is always internally stored as an integer bitmask value. The - * mapping between feature bitmask value and feature name is as follows: - * - * +1 -> layering - * +2 -> striping - * +4 -> exclusive-lock - * +8 -> object-map - * +16 -> fast-diff - * +32 -> deep-flatten - * +64 -> journaling - * +128 -> data-pool - */ -SAFE_OPTION(rbd_default_features, OPT_STR) - -OPTION(rbd_default_map_options, OPT_STR) // default rbd map -o / --options - -/** - * RBD journal options. - */ -OPTION(rbd_journal_order, OPT_U32) // bits to shift to compute journal object max size, between 12 and 64 -OPTION(rbd_journal_splay_width, OPT_U32) // number of active journal objects -OPTION(rbd_journal_commit_age, OPT_DOUBLE) // commit time interval, seconds -OPTION(rbd_journal_object_flush_interval, OPT_INT) // maximum number of pending commits per journal object -OPTION(rbd_journal_object_flush_bytes, OPT_INT) // maximum number of pending bytes per journal object -OPTION(rbd_journal_object_flush_age, OPT_DOUBLE) // maximum age (in seconds) for pending commits -OPTION(rbd_journal_pool, OPT_STR) // pool for journal objects -OPTION(rbd_journal_max_payload_bytes, OPT_U32) // maximum journal payload size before splitting -OPTION(rbd_journal_max_concurrent_object_sets, OPT_INT) // maximum number of object sets a journal client can be behind before it is automatically unregistered - -/** - * RBD Mirror options - */ -OPTION(rbd_mirror_journal_commit_age, OPT_DOUBLE) // commit time interval, seconds -OPTION(rbd_mirror_journal_poll_age, OPT_DOUBLE) // maximum age (in seconds) between successive journal polls -OPTION(rbd_mirror_journal_max_fetch_bytes, OPT_U32) // maximum bytes to read from each journal data object per fetch -OPTION(rbd_mirror_sync_point_update_age, OPT_DOUBLE) // number of seconds between each update of the image sync point object number -OPTION(rbd_mirror_concurrent_image_syncs, OPT_U32) // maximum number of image syncs in parallel -OPTION(rbd_mirror_pool_replayers_refresh_interval, OPT_INT) // interval to refresh peers in rbd-mirror daemon -OPTION(rbd_mirror_delete_retry_interval, OPT_DOUBLE) // interval to check and retry the failed requests in deleter -OPTION(rbd_mirror_image_state_check_interval, OPT_INT) // interval to get images from pool watcher and set sources in replayer -OPTION(rbd_mirror_leader_heartbeat_interval, OPT_INT) // interval (in seconds) between mirror leader heartbeats -OPTION(rbd_mirror_leader_max_missed_heartbeats, OPT_INT) // number of missed heartbeats for non-lock owner to attempt to acquire lock -OPTION(rbd_mirror_leader_max_acquire_attempts_before_break, OPT_INT) // number of failed attempts to acquire lock after missing heartbeats before breaking lock - OPTION(nss_db_path, OPT_STR) // path to nss db diff --git a/src/common/options.cc b/src/common/options.cc index 7b35baf9d2ed1..68982f1f376c1 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4948,7 +4948,7 @@ static std::vector