From 887a01f62cc01d48db99979cc6c78081465926a9 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 30 Mar 2011 16:17:48 -0700 Subject: [PATCH] config: parse_argv fix md_config_t::parse_argv: fold md_config_t::parse_argv_part2 into parse_argv. Fix brokenness introduced by the std::string switchover. OPTION macro: move single-character options out of the OPTION macro and into config.cc Fix ceph_argparse_witharg / ceph_argparse_flag uses to include a trailing (char*)NULL, to ensure that we terminate with a pointer rather than a 32-bit int. Signed-off-by: Colin McCabe --- src/common/ceph_argparse.cc | 10 +- src/common/config.cc | 710 ++++++++++++++++++------------------ src/common/config.h | 3 +- 3 files changed, 363 insertions(+), 360 deletions(-) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index b27e1d3428f3e..39ee867e80613 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -319,21 +319,21 @@ CephInitParameters ceph_argparse_early_args for (std::vector::iterator i = args.begin(); i != args.end(); ) { if (strcmp(*i, "--") == 0) break; - else if (ceph_argparse_flag(args, i, "--version", "-v", NULL)) { + else if (ceph_argparse_flag(args, i, "--version", "-v", (char*)NULL)) { cout << pretty_version_to_str() << std::endl; _exit(0); } - else if (ceph_argparse_witharg(args, i, &val, "--conf", "-c", NULL)) { + else if (ceph_argparse_witharg(args, i, &val, "--conf", "-c", (char*)NULL)) { iparams.conf_file = val; } else if ((module_type != CEPH_ENTITY_TYPE_CLIENT) && - (ceph_argparse_witharg(args, i, &val, "-i", NULL))) { + (ceph_argparse_witharg(args, i, &val, "-i", (char*)NULL))) { iparams.name.set_id(val); } - else if (ceph_argparse_witharg(args, i, &val, "--id", NULL)) { + else if (ceph_argparse_witharg(args, i, &val, "--id", (char*)NULL)) { iparams.name.set_id(val); } - else if (ceph_argparse_witharg(args, i, &val, "--name", "-n", NULL)) { + else if (ceph_argparse_witharg(args, i, &val, "--name", "-n", (char*)NULL)) { if (!iparams.name.from_str(val)) { std::cerr << "You must pass a string of the form ID.TYPE to " "the --name option." << std::endl; diff --git a/src/common/config.cc b/src/common/config.cc index a612242bfdd3d..60866a8315416 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -67,335 +67,334 @@ struct ceph_file_layout g_default_file_layout = { #define _STR(x) #x #define STRINGIFY(x) _STR(x) -#define OPTION_OPT_STR(section, name, schar, type, def_val) \ +#define OPTION_OPT_STR(section, name, type, def_val) \ { STRINGIFY(section), NULL, STRINGIFY(name), \ - &g_conf.name, def_val, 0, 0, type, schar } + &g_conf.name, def_val, 0, 0, type } -#define OPTION_OPT_ADDR(section, name, schar, type, def_val) \ +#define OPTION_OPT_ADDR(section, name, type, def_val) \ { STRINGIFY(section), NULL, STRINGIFY(name), \ - &g_conf.name, def_val, 0, 0, type, schar } + &g_conf.name, def_val, 0, 0, type } -#define OPTION_OPT_LONGLONG(section, name, schar, type, def_val) \ +#define OPTION_OPT_LONGLONG(section, name, type, def_val) \ { STRINGIFY(section), NULL, STRINGIFY(name), \ - &g_conf.name, 0, def_val, 0, type, schar } + &g_conf.name, 0, def_val, 0, type } #define OPTION_OPT_U32 OPTION_OPT_LONGLONG #define OPTION_OPT_INT OPTION_OPT_LONGLONG #define OPTION_OPT_BOOL OPTION_OPT_INT -#define OPTION_OPT_DOUBLE(section, name, schar, type, def_val) \ +#define OPTION_OPT_DOUBLE(section, name, type, def_val) \ { STRINGIFY(section), NULL, STRINGIFY(name), \ - &g_conf.name, 0, 0, def_val, type, schar } + &g_conf.name, 0, 0, def_val, type } #define OPTION_OPT_FLOAT OPTION_OPT_DOUBLE -#define OPTION(name, schar, type, def_val) OPTION_##type("global", name, schar, type, def_val) +#define OPTION(name, type, def_val) OPTION_##type("global", name, type, def_val) -#define OPTION_ALT(section, conf_name, name, schar, type, def_val) \ +#define OPTION_ALT(section, conf_name, name, type, def_val) \ { STRINGIFY(section), NULL, STRINGIFY(conf_name), \ - &g_conf.name, STRINGIFY(def_val), type, schar } + &g_conf.name, STRINGIFY(def_val), type } struct config_option config_optionsp[] = { - OPTION(host, 0, OPT_STR, "localhost"), - OPTION(public_addr, 0, OPT_ADDR, NULL), - OPTION(cluster_addr, 0, OPT_ADDR, NULL), - OPTION(num_client, 0, OPT_INT, 1), - OPTION(monmap, 'M', OPT_STR, 0), - OPTION(mon_host, 'm', OPT_STR, 0), - OPTION(daemonize, 0, OPT_BOOL, false), - OPTION(tcmalloc_profiler_run, 0, OPT_BOOL, false), - OPTION(profiler_allocation_interval, 0, OPT_INT, 1073741824), - OPTION(profiler_highwater_interval, 0, OPT_INT, 104857600), - OPTION(profiling_logger, 0, OPT_BOOL, false), - OPTION(profiling_logger_interval, 0, OPT_INT, 1), - OPTION(profiling_logger_calc_variance, 0, OPT_BOOL, false), - OPTION(profiling_logger_subdir, 0, OPT_STR, 0), - OPTION(profiling_logger_dir, 0, OPT_STR, "/var/log/ceph/stat"), - OPTION(log_file, 0, OPT_STR, 0), - OPTION(log_dir, 0, OPT_STR, 0), - OPTION(log_sym_dir, 0, OPT_STR, 0), - OPTION(log_sym_history, 0, OPT_INT, 10), - OPTION(log_to_stderr, 0, OPT_INT, LOG_TO_STDERR_ALL), - OPTION(log_to_syslog, 0, OPT_BOOL, false), - OPTION(log_per_instance, 0, OPT_BOOL, false), - OPTION(clog_to_monitors, 0, OPT_BOOL, true), - OPTION(clog_to_syslog, 0, OPT_BOOL, false), - OPTION(pid_file, 0, OPT_STR, 0), - OPTION(chdir, 0, OPT_STR, "/"), - OPTION(kill_after, 0, OPT_INT, 0), - OPTION(max_open_files, 0, OPT_LONGLONG, 0), - OPTION(debug, 0, OPT_INT, 0), - OPTION(debug_lockdep, 0, OPT_INT, 0), - OPTION(debug_context, 0, OPT_INT, 0), - OPTION(debug_mds, 0, OPT_INT, 1), - OPTION(debug_mds_balancer, 0, OPT_INT, 1), - OPTION(debug_mds_log, 0, OPT_INT, 1), - OPTION(debug_mds_log_expire, 0, OPT_INT, 1), - OPTION(debug_mds_migrator, 0, OPT_INT, 1), - OPTION(debug_buffer, 0, OPT_INT, 0), - OPTION(debug_timer, 0, OPT_INT, 0), - OPTION(debug_filer, 0, OPT_INT, 0), - OPTION(debug_objecter, 0, OPT_INT, 0), - OPTION(debug_rados, 0, OPT_INT, 0), - OPTION(debug_rbd, 0, OPT_INT, 0), - OPTION(debug_journaler, 0, OPT_INT, 0), - OPTION(debug_objectcacher, 0, OPT_INT, 0), - OPTION(debug_client, 0, OPT_INT, 0), - OPTION(debug_osd, 0, OPT_INT, 0), - OPTION(debug_ebofs, 0, OPT_INT, 1), - OPTION(debug_filestore, 0, OPT_INT, 1), - OPTION(debug_journal, 0, OPT_INT, 1), - OPTION(debug_bdev, 0, OPT_INT, 1), // block device - OPTION(debug_ms, 0, OPT_INT, 0), - OPTION(debug_mon, 0, OPT_INT, 1), - OPTION(debug_monc, 0, OPT_INT, 0), - OPTION(debug_paxos, 0, OPT_INT, 0), - OPTION(debug_tp, 0, OPT_INT, 0), - OPTION(debug_auth, 0, OPT_INT, 1), - OPTION(debug_finisher, 0, OPT_INT, 1), - OPTION(key, 0, OPT_STR, 0), - OPTION(keyfile, 'K', OPT_STR, 0), - OPTION(keyring, 'k', OPT_STR, "/etc/ceph/keyring,/etc/ceph/keyring.bin"), - OPTION(buffer_track_alloc, 0, OPT_BOOL, false), - OPTION(ms_tcp_nodelay, 0, OPT_BOOL, true), - OPTION(ms_initial_backoff, 0, OPT_DOUBLE, .2), - OPTION(ms_max_backoff, 0, OPT_DOUBLE, 15.0), - OPTION(ms_nocrc, 0, OPT_BOOL, false), - OPTION(ms_die_on_bad_msg, 0, OPT_BOOL, false), - OPTION(ms_dispatch_throttle_bytes, 0, OPT_LONGLONG, 100 << 20), - OPTION(ms_bind_ipv6, 0, OPT_BOOL, false), - OPTION(ms_rwthread_stack_bytes, 0, OPT_LONGLONG, 1024 << 10), - OPTION(ms_tcp_read_timeout, 0, OPT_LONGLONG, 900), - OPTION(ms_inject_socket_failures, 0, OPT_LONGLONG, 0), - OPTION(mon_data, 0, OPT_STR, 0), - OPTION(mon_tick_interval, 0, OPT_INT, 5), - OPTION(mon_subscribe_interval, 0, OPT_DOUBLE, 300), - OPTION(mon_osd_down_out_interval, 0, OPT_INT, 300), // seconds - OPTION(mon_lease, 0, OPT_FLOAT, 5), // lease interval - OPTION(mon_lease_renew_interval, 0, OPT_FLOAT, 3), // on leader, to renew the lease - OPTION(mon_lease_ack_timeout, 0, OPT_FLOAT, 10.0), // on leader, if lease isn't acked by all peons - OPTION(mon_clock_drift_allowed, 0, OPT_FLOAT, .010), // allowed clock drift between monitors - OPTION(mon_clock_drift_warn_backoff, 0, OPT_FLOAT, 5), // exponential backoff for clock drift warnings - OPTION(mon_accept_timeout, 0, OPT_FLOAT, 10.0), // on leader, if paxos update isn't accepted - OPTION(mon_pg_create_interval, 0, OPT_FLOAT, 30.0), // no more than every 30s - OPTION(mon_osd_full_ratio, 0, OPT_INT, 95), // what % full makes an OSD "full" - OPTION(mon_osd_nearfull_ratio, 0, OPT_INT, 85), // what % full makes an OSD near full - OPTION(mon_globalid_prealloc, 0, OPT_INT, 100), // how many globalids to prealloc - OPTION(mon_osd_report_timeout, 0, OPT_INT, 900), // grace period before declaring unresponsive OSDs dead - OPTION(mon_force_standby_active, 0, OPT_BOOL, true), // should mons force standby-replay mds to be active - OPTION(paxos_propose_interval, 0, OPT_DOUBLE, 1.0), // gather updates for this long before proposing a map update - OPTION(paxos_min_wait, 0, OPT_DOUBLE, 0.05), // min time to gather updates for after period of inactivity - OPTION(paxos_observer_timeout, 0, OPT_DOUBLE, 5*60), // gather updates for this long before proposing a map update - OPTION(auth_supported, 0, OPT_STR, "none"), - OPTION(auth_mon_ticket_ttl, 0, OPT_DOUBLE, 60*60*12), - OPTION(auth_service_ticket_ttl, 0, OPT_DOUBLE, 60*60), - OPTION(mon_client_hunt_interval, 0, OPT_DOUBLE, 3.0), // try new mon every N seconds until we connect - OPTION(mon_client_ping_interval, 0, OPT_DOUBLE, 10.0), // ping every N seconds - OPTION(client_cache_size, 0, OPT_INT, 16384), - OPTION(client_cache_mid, 0, OPT_FLOAT, .75), - OPTION(client_cache_stat_ttl, 0, OPT_INT, 0), // seconds until cached stat results become invalid - OPTION(client_cache_readdir_ttl, 0, OPT_INT, 1), // 1 second only - OPTION(client_use_random_mds, 0, OPT_BOOL, false), - OPTION(client_mount_timeout, 0, OPT_DOUBLE, 30.0), - OPTION(client_unmount_timeout, 0, OPT_DOUBLE, 10.0), - OPTION(client_tick_interval, 0, OPT_DOUBLE, 1.0), - OPTION(client_trace, 0, OPT_STR, 0), - OPTION(client_readahead_min, 0, OPT_LONGLONG, 128*1024), // readahead at _least_ this much. - OPTION(client_readahead_max_bytes, 0, OPT_LONGLONG, 0), //8 * 1024*1024, - OPTION(client_readahead_max_periods, 0, OPT_LONGLONG, 4), // as multiple of file layout period (object size * num stripes) - OPTION(client_snapdir, 0, OPT_STR, ".snap"), - OPTION(client_mountpoint, 'r', OPT_STR, "/"), - OPTION(client_notify_timeout, 0, OPT_INT, 10), // in seconds - OPTION(client_oc, 0, OPT_BOOL, true), - OPTION(client_oc_size, 0, OPT_INT, 1024*1024* 200), // MB * n - OPTION(client_oc_max_dirty, 0, OPT_INT, 1024*1024* 100), // MB * n (dirty OR tx.. bigish) - OPTION(client_oc_target_dirty, 0, OPT_INT, 1024*1024* 8), // target dirty (keep this smallish) + OPTION(host, OPT_STR, "localhost"), + OPTION(public_addr, OPT_ADDR, NULL), + OPTION(cluster_addr, OPT_ADDR, NULL), + OPTION(num_client, OPT_INT, 1), + OPTION(monmap, OPT_STR, 0), + OPTION(mon_host, OPT_STR, 0), + OPTION(daemonize, OPT_BOOL, false), + OPTION(tcmalloc_profiler_run, OPT_BOOL, false), + OPTION(profiler_allocation_interval, OPT_INT, 1073741824), + OPTION(profiler_highwater_interval, OPT_INT, 104857600), + OPTION(profiling_logger, OPT_BOOL, false), + OPTION(profiling_logger_interval, OPT_INT, 1), + OPTION(profiling_logger_calc_variance, OPT_BOOL, false), + OPTION(profiling_logger_subdir, OPT_STR, 0), + OPTION(profiling_logger_dir, OPT_STR, "/var/log/ceph/stat"), + OPTION(log_file, OPT_STR, 0), + OPTION(log_dir, OPT_STR, 0), + OPTION(log_sym_dir, OPT_STR, 0), + OPTION(log_sym_history, OPT_INT, 10), + OPTION(log_to_stderr, OPT_INT, LOG_TO_STDERR_ALL), + OPTION(log_to_syslog, OPT_BOOL, false), + OPTION(log_per_instance, OPT_BOOL, false), + OPTION(clog_to_monitors, OPT_BOOL, true), + OPTION(clog_to_syslog, OPT_BOOL, false), + OPTION(pid_file, OPT_STR, 0), + OPTION(chdir, OPT_STR, "/"), + OPTION(max_open_files, OPT_LONGLONG, 0), + OPTION(debug, OPT_INT, 0), + OPTION(debug_lockdep, OPT_INT, 0), + OPTION(debug_context, OPT_INT, 0), + OPTION(debug_mds, OPT_INT, 1), + OPTION(debug_mds_balancer, OPT_INT, 1), + OPTION(debug_mds_log, OPT_INT, 1), + OPTION(debug_mds_log_expire, OPT_INT, 1), + OPTION(debug_mds_migrator, OPT_INT, 1), + OPTION(debug_buffer, OPT_INT, 0), + OPTION(debug_timer, OPT_INT, 0), + OPTION(debug_filer, OPT_INT, 0), + OPTION(debug_objecter, OPT_INT, 0), + OPTION(debug_rados, OPT_INT, 0), + OPTION(debug_rbd, OPT_INT, 0), + OPTION(debug_journaler, OPT_INT, 0), + OPTION(debug_objectcacher, OPT_INT, 0), + OPTION(debug_client, OPT_INT, 0), + OPTION(debug_osd, OPT_INT, 0), + OPTION(debug_ebofs, OPT_INT, 1), + OPTION(debug_filestore, OPT_INT, 1), + OPTION(debug_journal, OPT_INT, 1), + OPTION(debug_bdev, OPT_INT, 1), // block device + OPTION(debug_ms, OPT_INT, 0), + OPTION(debug_mon, OPT_INT, 1), + OPTION(debug_monc, OPT_INT, 0), + OPTION(debug_paxos, OPT_INT, 0), + OPTION(debug_tp, OPT_INT, 0), + OPTION(debug_auth, OPT_INT, 1), + OPTION(debug_finisher, OPT_INT, 1), + OPTION(key, OPT_STR, 0), + OPTION(keyfile, OPT_STR, 0), + OPTION(keyring, OPT_STR, "/etc/ceph/keyring,/etc/ceph/keyring.bin"), + OPTION(buffer_track_alloc, OPT_BOOL, false), + OPTION(ms_tcp_nodelay, OPT_BOOL, true), + OPTION(ms_initial_backoff, OPT_DOUBLE, .2), + OPTION(ms_max_backoff, OPT_DOUBLE, 15.0), + OPTION(ms_nocrc, OPT_BOOL, false), + OPTION(ms_die_on_bad_msg, OPT_BOOL, false), + OPTION(ms_dispatch_throttle_bytes, OPT_LONGLONG, 100 << 20), + OPTION(ms_bind_ipv6, OPT_BOOL, false), + OPTION(ms_rwthread_stack_bytes, OPT_LONGLONG, 1024 << 10), + OPTION(ms_tcp_read_timeout, OPT_LONGLONG, 900), + OPTION(ms_inject_socket_failures, OPT_LONGLONG, 0), + OPTION(mon_data, OPT_STR, 0), + OPTION(mon_tick_interval, OPT_INT, 5), + OPTION(mon_subscribe_interval, OPT_DOUBLE, 300), + OPTION(mon_osd_down_out_interval, OPT_INT, 300), // seconds + OPTION(mon_lease, OPT_FLOAT, 5), // lease interval + OPTION(mon_lease_renew_interval, OPT_FLOAT, 3), // on leader, to renew the lease + OPTION(mon_lease_ack_timeout, OPT_FLOAT, 10.0), // on leader, if lease isn't acked by all peons + OPTION(mon_clock_drift_allowed, OPT_FLOAT, .010), // allowed clock drift between monitors + OPTION(mon_clock_drift_warn_backoff, OPT_FLOAT, 5), // exponential backoff for clock drift warnings + OPTION(mon_accept_timeout, OPT_FLOAT, 10.0), // on leader, if paxos update isn't accepted + OPTION(mon_pg_create_interval, OPT_FLOAT, 30.0), // no more than every 30s + OPTION(mon_osd_full_ratio, OPT_INT, 95), // what % full makes an OSD "full" + OPTION(mon_osd_nearfull_ratio, OPT_INT, 85), // what % full makes an OSD near full + OPTION(mon_globalid_prealloc, OPT_INT, 100), // how many globalids to prealloc + OPTION(mon_osd_report_timeout, OPT_INT, 900), // grace period before declaring unresponsive OSDs dead + OPTION(mon_force_standby_active, OPT_BOOL, true), // should mons force standby-replay mds to be active + OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0), // gather updates for this long before proposing a map update + OPTION(paxos_min_wait, OPT_DOUBLE, 0.05), // min time to gather updates for after period of inactivity + OPTION(paxos_observer_timeout, OPT_DOUBLE, 5*60), // gather updates for this long before proposing a map update + OPTION(auth_supported, OPT_STR, "none"), + OPTION(auth_mon_ticket_ttl, OPT_DOUBLE, 60*60*12), + OPTION(auth_service_ticket_ttl, OPT_DOUBLE, 60*60), + OPTION(mon_client_hunt_interval, OPT_DOUBLE, 3.0), // try new mon every N seconds until we connect + OPTION(mon_client_ping_interval, OPT_DOUBLE, 10.0), // ping every N seconds + OPTION(client_cache_size, OPT_INT, 16384), + OPTION(client_cache_mid, OPT_FLOAT, .75), + OPTION(client_cache_stat_ttl, OPT_INT, 0), // seconds until cached stat results become invalid + OPTION(client_cache_readdir_ttl, OPT_INT, 1), // 1 second only + OPTION(client_use_random_mds, OPT_BOOL, false), + OPTION(client_mount_timeout, OPT_DOUBLE, 30.0), + OPTION(client_unmount_timeout, OPT_DOUBLE, 10.0), + OPTION(client_tick_interval, OPT_DOUBLE, 1.0), + OPTION(client_trace, OPT_STR, 0), + OPTION(client_readahead_min, OPT_LONGLONG, 128*1024), // readahead at _least_ this much. + OPTION(client_readahead_max_bytes, OPT_LONGLONG, 0), //8 * 1024*1024, + OPTION(client_readahead_max_periods, OPT_LONGLONG, 4), // as multiple of file layout period (object size * num stripes) + OPTION(client_snapdir, OPT_STR, ".snap"), + OPTION(client_mountpoint, OPT_STR, "/"), + OPTION(client_notify_timeout, OPT_INT, 10), // in seconds + OPTION(client_oc, OPT_BOOL, true), + OPTION(client_oc_size, OPT_INT, 1024*1024* 200), // MB * n + OPTION(client_oc_max_dirty, OPT_INT, 1024*1024* 100), // MB * n (dirty OR tx.. bigish) + OPTION(client_oc_target_dirty, OPT_INT, 1024*1024* 8), // target dirty (keep this smallish) // note: the max amount of "in flight" dirty data is roughly (max - target) - OPTION(client_oc_max_sync_write, 0, OPT_LONGLONG, 128*1024), // sync writes >= this use wrlock - OPTION(objecter_tick_interval, 0, OPT_DOUBLE, 5.0), - OPTION(objecter_mon_retry_interval, 0, OPT_DOUBLE, 5.0), - OPTION(objecter_timeout, 0, OPT_DOUBLE, 10.0), // before we ask for a map - OPTION(objecter_inflight_op_bytes, 0, OPT_LONGLONG, 1024*1024*100), //max in-flight data (both directions) - OPTION(journaler_allow_split_entries, 0, OPT_BOOL, true), - OPTION(journaler_write_head_interval, 0, OPT_INT, 15), - OPTION(journaler_prefetch_periods, 0, OPT_INT, 10), // * journal object size (1~MB? see above) - OPTION(journaler_batch_interval, 0, OPT_DOUBLE, .001), // seconds.. max add'l latency we artificially incur - OPTION(journaler_batch_max, 0, OPT_LONGLONG, 0), // max bytes we'll delay flushing; disable, for now.... - OPTION(mds_max_file_size, 0, OPT_LONGLONG, 1ULL << 40), - OPTION(mds_cache_size, 0, OPT_INT, 100000), - OPTION(mds_cache_mid, 0, OPT_FLOAT, .7), - OPTION(mds_mem_max, 0, OPT_INT, 1048576), // KB - OPTION(mds_dir_commit_ratio, 0, OPT_FLOAT, .5), - OPTION(mds_dir_max_commit_size, 0, OPT_INT, 90), // MB - OPTION(mds_decay_halflife, 0, OPT_FLOAT, 5), - OPTION(mds_beacon_interval, 0, OPT_FLOAT, 4), - OPTION(mds_beacon_grace, 0, OPT_FLOAT, 15), - OPTION(mds_blacklist_interval, 0, OPT_FLOAT, 24.0*60.0), // how long to blacklist failed nodes - OPTION(mds_session_timeout, 0, OPT_FLOAT, 60), // cap bits and leases time out if client idle - OPTION(mds_session_autoclose, 0, OPT_FLOAT, 300), // autoclose idle session - OPTION(mds_reconnect_timeout, 0, OPT_FLOAT, 45), // seconds to wait for clients during mds restart + OPTION(client_oc_max_sync_write, OPT_LONGLONG, 128*1024), // sync writes >= this use wrlock + OPTION(objecter_tick_interval, OPT_DOUBLE, 5.0), + OPTION(objecter_mon_retry_interval, OPT_DOUBLE, 5.0), + OPTION(objecter_timeout, OPT_DOUBLE, 10.0), // before we ask for a map + OPTION(objecter_inflight_op_bytes, OPT_LONGLONG, 1024*1024*100), //max in-flight data (both directions) + OPTION(journaler_allow_split_entries, OPT_BOOL, true), + OPTION(journaler_write_head_interval, OPT_INT, 15), + OPTION(journaler_prefetch_periods, OPT_INT, 10), // * journal object size (1~MB? see above) + OPTION(journaler_batch_interval, OPT_DOUBLE, .001), // seconds.. max add'l latency we artificially incur + OPTION(journaler_batch_max, OPT_LONGLONG, 0), // max bytes we'll delay flushing; disable, for now.... + OPTION(mds_max_file_size, OPT_LONGLONG, 1ULL << 40), + OPTION(mds_cache_size, OPT_INT, 100000), + OPTION(mds_cache_mid, OPT_FLOAT, .7), + OPTION(mds_mem_max, OPT_INT, 1048576), // KB + OPTION(mds_dir_commit_ratio, OPT_FLOAT, .5), + OPTION(mds_dir_max_commit_size, OPT_INT, 90), // MB + OPTION(mds_decay_halflife, OPT_FLOAT, 5), + OPTION(mds_beacon_interval, OPT_FLOAT, 4), + OPTION(mds_beacon_grace, OPT_FLOAT, 15), + OPTION(mds_blacklist_interval, OPT_FLOAT, 24.0*60.0), // how long to blacklist failed nodes + OPTION(mds_session_timeout, OPT_FLOAT, 60), // cap bits and leases time out if client idle + OPTION(mds_session_autoclose, OPT_FLOAT, 300), // autoclose idle session + OPTION(mds_reconnect_timeout, OPT_FLOAT, 45), // seconds to wait for clients during mds restart // make it (mds_session_timeout - mds_beacon_grace) - OPTION(mds_tick_interval, 0, OPT_FLOAT, 5), - OPTION(mds_dirstat_min_interval, 0, OPT_FLOAT, 1), // try to avoid propagating more often than this - OPTION(mds_scatter_nudge_interval, 0, OPT_FLOAT, 5), // how quickly dirstat changes propagate up the hierarchy - OPTION(mds_client_prealloc_inos, 0, OPT_INT, 1000), - OPTION(mds_early_reply, 0, OPT_BOOL, true), - OPTION(mds_use_tmap, 0, OPT_BOOL, true), // use trivialmap for dir updates - OPTION(mds_default_dir_hash, 0, OPT_INT, CEPH_STR_HASH_RJENKINS), - OPTION(mds_log, 0, OPT_BOOL, true), - OPTION(mds_log_skip_corrupt_events, 0, OPT_BOOL, false), - OPTION(mds_log_max_events, 0, OPT_INT, -1), - OPTION(mds_log_max_segments, 0, OPT_INT, 30), // segment size defined by FileLayout, above - OPTION(mds_log_max_expiring, 0, OPT_INT, 20), - OPTION(mds_log_eopen_size, 0, OPT_INT, 100), // # open inodes per log entry - OPTION(mds_bal_sample_interval, 0, OPT_FLOAT, 3.0), // every 5 seconds - OPTION(mds_bal_replicate_threshold, 0, OPT_FLOAT, 8000), - OPTION(mds_bal_unreplicate_threshold, 0, OPT_FLOAT, 0), - OPTION(mds_bal_frag, 0, OPT_BOOL, false), - OPTION(mds_bal_split_size, 0, OPT_INT, 10000), - OPTION(mds_bal_split_rd, 0, OPT_FLOAT, 25000), - OPTION(mds_bal_split_wr, 0, OPT_FLOAT, 10000), - OPTION(mds_bal_split_bits, 0, OPT_INT, 3), - OPTION(mds_bal_merge_size, 0, OPT_INT, 50), - OPTION(mds_bal_merge_rd, 0, OPT_FLOAT, 1000), - OPTION(mds_bal_merge_wr, 0, OPT_FLOAT, 1000), - OPTION(mds_bal_interval, 0, OPT_INT, 10), // seconds - OPTION(mds_bal_fragment_interval, 0, OPT_INT, 5), // seconds - OPTION(mds_bal_idle_threshold, 0, OPT_FLOAT, 0), - OPTION(mds_bal_max, 0, OPT_INT, -1), - OPTION(mds_bal_max_until, 0, OPT_INT, -1), - OPTION(mds_bal_mode, 0, OPT_INT, 0), - OPTION(mds_bal_min_rebalance, 0, OPT_FLOAT, .1), // must be this much above average before we export anything - OPTION(mds_bal_min_start, 0, OPT_FLOAT, .2), // if we need less than this, we don't do anything - OPTION(mds_bal_need_min, 0, OPT_FLOAT, .8), // take within this range of what we need - OPTION(mds_bal_need_max, 0, OPT_FLOAT, 1.2), - OPTION(mds_bal_midchunk, 0, OPT_FLOAT, .3), // any sub bigger than this taken in full - OPTION(mds_bal_minchunk, 0, OPT_FLOAT, .001), // never take anything smaller than this - OPTION(mds_bal_target_removal_min, 0, OPT_INT, 5), // min balance iterations before old target is removed - OPTION(mds_bal_target_removal_max, 0, OPT_INT, 10), // max balance iterations before old target is removed - OPTION(mds_replay_interval, 0, OPT_FLOAT, 1.0), // time to wait before starting replay again - OPTION(mds_shutdown_check, 0, OPT_INT, 0), - OPTION(mds_thrash_exports, 0, OPT_INT, 0), - OPTION(mds_thrash_fragments, 0, OPT_INT, 0), - OPTION(mds_dump_cache_on_map, 0, OPT_BOOL, false), - OPTION(mds_dump_cache_after_rejoin, 0, OPT_BOOL, false), - OPTION(mds_verify_scatter, 0, OPT_BOOL, false), - OPTION(mds_debug_scatterstat, 0, OPT_BOOL, false), - OPTION(mds_debug_frag, 0, OPT_BOOL, false), - OPTION(mds_kill_mdstable_at, 0, OPT_INT, 0), - OPTION(mds_kill_export_at, 0, OPT_INT, 0), - OPTION(mds_kill_import_at, 0, OPT_INT, 0), - OPTION(mds_kill_rename_at, 0, OPT_INT, 0), - OPTION(mds_wipe_sessions, 0, OPT_BOOL, 0), - OPTION(mds_wipe_ino_prealloc, 0, OPT_BOOL, 0), - OPTION(mds_skip_ino, 0, OPT_INT, 0), - OPTION(max_mds, 0, OPT_INT, 1), - OPTION(mds_standby_for_name, 0, OPT_STR, 0), - OPTION(mds_standby_for_rank, 0, OPT_INT, -1), - OPTION(mds_standby_replay, 0, OPT_BOOL, false), - OPTION(osd_data, 0, OPT_STR, 0), - OPTION(osd_journal, 0, OPT_STR, 0), - OPTION(osd_journal_size, 0, OPT_INT, 0), // in mb - OPTION(osd_max_write_size, 0, OPT_INT, 90), - OPTION(osd_balance_reads, 0, OPT_BOOL, false), - OPTION(osd_flash_crowd_iat_threshold, 0, OPT_INT, 0), - OPTION(osd_flash_crowd_iat_alpha, 0, OPT_DOUBLE, 0.125), - OPTION(osd_shed_reads, 0, OPT_INT, false), // forward from primary to replica - OPTION(osd_shed_reads_min_latency, 0, OPT_DOUBLE, .01), // min local latency - OPTION(osd_shed_reads_min_latency_diff, 0, OPT_DOUBLE, .01), // min latency difference - OPTION(osd_shed_reads_min_latency_ratio, 0, OPT_DOUBLE, 1.5), // 1.2 == 20% higher than peer - OPTION(osd_client_message_size_cap, 0, OPT_LONGLONG, 500*1024L*1024L), // default to 200MB client data allowed in-memory - OPTION(osd_stat_refresh_interval, 0, OPT_DOUBLE, .5), - OPTION(osd_pg_bits, 0, OPT_INT, 6), // bits per osd - OPTION(osd_pgp_bits, 0, OPT_INT, 6), // bits per osd - OPTION(osd_lpg_bits, 0, OPT_INT, 2), // bits per osd - OPTION(osd_pg_layout, 0, OPT_INT, CEPH_PG_LAYOUT_CRUSH), - OPTION(osd_min_rep, 0, OPT_INT, 1), - OPTION(osd_max_rep, 0, OPT_INT, 10), - OPTION(osd_min_raid_width, 0, OPT_INT, 3), - OPTION(osd_max_raid_width, 0, OPT_INT, 2), - OPTION(osd_pool_default_crush_rule, 0, OPT_INT, 0), - OPTION(osd_pool_default_size, 0, OPT_INT, 2), - OPTION(osd_pool_default_pg_num, 0, OPT_INT, 8), - OPTION(osd_pool_default_pgp_num, 0, OPT_INT, 8), - OPTION(osd_op_threads, 0, OPT_INT, 2), // 0 == no threading - OPTION(osd_max_opq, 0, OPT_INT, 10), - OPTION(osd_disk_threads, 0, OPT_INT, 1), - OPTION(osd_recovery_threads, 0, OPT_INT, 1), - OPTION(osd_age, 0, OPT_FLOAT, .8), - OPTION(osd_age_time, 0, OPT_INT, 0), - OPTION(osd_heartbeat_interval, 0, OPT_INT, 1), - OPTION(osd_mon_heartbeat_interval, 0, OPT_INT, 30), // if no peers, ping monitor - OPTION(osd_heartbeat_grace, 0, OPT_INT, 20), - OPTION(osd_mon_report_interval_max, 0, OPT_INT, 120), - OPTION(osd_mon_report_interval_min, 0, OPT_INT, 5), // pg stats, failures, up_thru, boot. - OPTION(osd_min_down_reporters, 0, OPT_INT, 1), // number of OSDs who need to report a down OSD for it to count - OPTION(osd_min_down_reports, 0, OPT_INT, 3), // number of times a down OSD must be reported for it to count - OPTION(osd_replay_window, 0, OPT_INT, 45), - OPTION(osd_preserve_trimmed_log, 0, OPT_BOOL, true), - OPTION(osd_recovery_delay_start, 0, OPT_FLOAT, 15), - OPTION(osd_recovery_max_active, 0, OPT_INT, 5), - OPTION(osd_recovery_max_chunk, 0, OPT_LONGLONG, 1<<20), // max size of push chunk - OPTION(osd_recovery_forget_lost_objects, 0, OPT_BOOL, false), // off for now - OPTION(osd_max_scrubs, 0, OPT_INT, 1), - OPTION(osd_scrub_load_threshold, 0, OPT_FLOAT, 0.5), - OPTION(osd_scrub_min_interval, 0, OPT_FLOAT, 300), - OPTION(osd_scrub_max_interval, 0, OPT_FLOAT, 60*60*24), // once a day - OPTION(osd_auto_weight, 0, OPT_BOOL, false), - OPTION(osd_class_error_timeout, 0, OPT_DOUBLE, 60.0), // seconds - OPTION(osd_class_timeout, 0, OPT_DOUBLE, 60*60.0), // seconds - OPTION(osd_class_tmp, 0, OPT_STR, "/var/lib/ceph/tmp"), - OPTION(osd_check_for_log_corruption, 0, OPT_BOOL, false), - OPTION(osd_use_stale_snap, 0, OPT_BOOL, false), - OPTION(osd_max_notify_timeout, 0, OPT_U32, 30), // max notify timeout in seconds - OPTION(filestore, 0, OPT_BOOL, false), - OPTION(filestore_max_sync_interval, 0, OPT_DOUBLE, 5), // seconds - OPTION(filestore_min_sync_interval, 0, OPT_DOUBLE, .01), // seconds - OPTION(filestore_fake_attrs, 0, OPT_BOOL, false), - OPTION(filestore_fake_collections, 0, OPT_BOOL, false), - OPTION(filestore_dev, 0, OPT_STR, 0), - OPTION(filestore_btrfs_trans, 0, OPT_BOOL, false), - OPTION(filestore_btrfs_snap, 0, OPT_BOOL, true), - OPTION(filestore_btrfs_clone_range, 0, OPT_BOOL, true), - OPTION(filestore_fsync_flushes_journal_data, 0, OPT_BOOL, false), - OPTION(filestore_flusher, 0, OPT_BOOL, true), - OPTION(filestore_flusher_max_fds, 0, OPT_INT, 512), - OPTION(filestore_sync_flush, 0, OPT_BOOL, false), - OPTION(filestore_journal_parallel, 0, OPT_BOOL, false), - OPTION(filestore_journal_writeahead, 0, OPT_BOOL, false), - OPTION(filestore_journal_trailing, 0, OPT_BOOL, false), - OPTION(filestore_queue_max_ops, 0, OPT_INT, 500), - OPTION(filestore_queue_max_bytes, 0, OPT_INT, 100 << 20), - OPTION(filestore_queue_committing_max_ops, 0, OPT_INT, 500), // this is ON TOP of filestore_queue_max_* - OPTION(filestore_queue_committing_max_bytes, 0, OPT_INT, 100 << 20), // " - OPTION(filestore_op_threads, 0, OPT_INT, 2), - OPTION(filestore_commit_timeout, 0, OPT_FLOAT, 600), - OPTION(ebofs, 0, OPT_BOOL, false), - OPTION(ebofs_cloneable, 0, OPT_BOOL, true), - OPTION(ebofs_verify, 0, OPT_BOOL, false), - OPTION(ebofs_commit_ms, 0, OPT_INT, 200), // 0 = no forced commit timeout (for debugging/tracing) - OPTION(ebofs_oc_size, 0, OPT_INT, 10000), // onode cache - OPTION(ebofs_cc_size, 0, OPT_INT, 10000), // cnode cache - OPTION(ebofs_bc_size, 0, OPT_LONGLONG, 50*256), // 4k blocks, *256 for MB - OPTION(ebofs_bc_max_dirty, 0, OPT_LONGLONG, 30*256), // before write() will block - OPTION(ebofs_max_prefetch, 0, OPT_INT, 1000), // 4k blocks - OPTION(ebofs_realloc, 0, OPT_BOOL, false), // hrm, this can cause bad fragmentation, don't use! - OPTION(ebofs_verify_csum_on_read, 0, OPT_BOOL, true), - OPTION(journal_dio, 0, OPT_BOOL, true), - OPTION(journal_block_align, 0, OPT_BOOL, true), - OPTION(journal_max_write_bytes, 0, OPT_INT, 10 << 20), - OPTION(journal_max_write_entries, 0, OPT_INT, 100), - OPTION(journal_queue_max_ops, 0, OPT_INT, 500), - OPTION(journal_queue_max_bytes, 0, OPT_INT, 100 << 20), - OPTION(journal_align_min_size, 0, OPT_INT, 64 << 10), // align data payloads >= this. - OPTION(bdev_lock, 0, OPT_BOOL, true), - OPTION(bdev_iothreads, 0, OPT_INT, 1), // number of ios to queue with kernel - OPTION(bdev_idle_kick_after_ms, 0, OPT_INT, 100), // ms - OPTION(bdev_el_fw_max_ms, 0, OPT_INT, 10000), // restart elevator at least once every 1000 ms - OPTION(bdev_el_bw_max_ms, 0, OPT_INT, 3000), // restart elevator at least once every 300 ms - OPTION(bdev_el_bidir, 0, OPT_BOOL, false), // bidirectional elevator? - OPTION(bdev_iov_max, 0, OPT_INT, 512), // max # iov's to collect into a single readv()/writev() call - OPTION(bdev_debug_check_io_overlap, 0, OPT_BOOL, true), // [DEBUG] check for any pending io overlaps - OPTION(bdev_fake_mb, 0, OPT_INT, 0), - OPTION(bdev_fake_max_mb, 0, OPT_INT, 0), + OPTION(mds_tick_interval, OPT_FLOAT, 5), + OPTION(mds_dirstat_min_interval, OPT_FLOAT, 1), // try to avoid propagating more often than this + OPTION(mds_scatter_nudge_interval, OPT_FLOAT, 5), // how quickly dirstat changes propagate up the hierarchy + OPTION(mds_client_prealloc_inos, OPT_INT, 1000), + OPTION(mds_early_reply, OPT_BOOL, true), + OPTION(mds_use_tmap, OPT_BOOL, true), // use trivialmap for dir updates + OPTION(mds_default_dir_hash, OPT_INT, CEPH_STR_HASH_RJENKINS), + OPTION(mds_log, OPT_BOOL, true), + OPTION(mds_log_skip_corrupt_events, OPT_BOOL, false), + OPTION(mds_log_max_events, OPT_INT, -1), + OPTION(mds_log_max_segments, OPT_INT, 30), // segment size defined by FileLayout, above + OPTION(mds_log_max_expiring, OPT_INT, 20), + OPTION(mds_log_eopen_size, OPT_INT, 100), // # open inodes per log entry + OPTION(mds_bal_sample_interval, OPT_FLOAT, 3.0), // every 5 seconds + OPTION(mds_bal_replicate_threshold, OPT_FLOAT, 8000), + OPTION(mds_bal_unreplicate_threshold, OPT_FLOAT, 0), + OPTION(mds_bal_frag, OPT_BOOL, false), + OPTION(mds_bal_split_size, OPT_INT, 10000), + OPTION(mds_bal_split_rd, OPT_FLOAT, 25000), + OPTION(mds_bal_split_wr, OPT_FLOAT, 10000), + OPTION(mds_bal_split_bits, OPT_INT, 3), + OPTION(mds_bal_merge_size, OPT_INT, 50), + OPTION(mds_bal_merge_rd, OPT_FLOAT, 1000), + OPTION(mds_bal_merge_wr, OPT_FLOAT, 1000), + OPTION(mds_bal_interval, OPT_INT, 10), // seconds + OPTION(mds_bal_fragment_interval, OPT_INT, 5), // seconds + OPTION(mds_bal_idle_threshold, OPT_FLOAT, 0), + OPTION(mds_bal_max, OPT_INT, -1), + OPTION(mds_bal_max_until, OPT_INT, -1), + OPTION(mds_bal_mode, OPT_INT, 0), + OPTION(mds_bal_min_rebalance, OPT_FLOAT, .1), // must be this much above average before we export anything + OPTION(mds_bal_min_start, OPT_FLOAT, .2), // if we need less than this, we don't do anything + OPTION(mds_bal_need_min, OPT_FLOAT, .8), // take within this range of what we need + OPTION(mds_bal_need_max, OPT_FLOAT, 1.2), + OPTION(mds_bal_midchunk, OPT_FLOAT, .3), // any sub bigger than this taken in full + OPTION(mds_bal_minchunk, OPT_FLOAT, .001), // never take anything smaller than this + OPTION(mds_bal_target_removal_min, OPT_INT, 5), // min balance iterations before old target is removed + OPTION(mds_bal_target_removal_max, OPT_INT, 10), // max balance iterations before old target is removed + OPTION(mds_replay_interval, OPT_FLOAT, 1.0), // time to wait before starting replay again + OPTION(mds_shutdown_check, OPT_INT, 0), + OPTION(mds_thrash_exports, OPT_INT, 0), + OPTION(mds_thrash_fragments, OPT_INT, 0), + OPTION(mds_dump_cache_on_map, OPT_BOOL, false), + OPTION(mds_dump_cache_after_rejoin, OPT_BOOL, false), + OPTION(mds_verify_scatter, OPT_BOOL, false), + OPTION(mds_debug_scatterstat, OPT_BOOL, false), + OPTION(mds_debug_frag, OPT_BOOL, false), + OPTION(mds_kill_mdstable_at, OPT_INT, 0), + OPTION(mds_kill_export_at, OPT_INT, 0), + OPTION(mds_kill_import_at, OPT_INT, 0), + OPTION(mds_kill_rename_at, OPT_INT, 0), + OPTION(mds_wipe_sessions, OPT_BOOL, 0), + OPTION(mds_wipe_ino_prealloc, OPT_BOOL, 0), + OPTION(mds_skip_ino, OPT_INT, 0), + OPTION(max_mds, OPT_INT, 1), + OPTION(mds_standby_for_name, OPT_STR, 0), + OPTION(mds_standby_for_rank, OPT_INT, -1), + OPTION(mds_standby_replay, OPT_BOOL, false), + OPTION(osd_data, OPT_STR, 0), + OPTION(osd_journal, OPT_STR, 0), + OPTION(osd_journal_size, OPT_INT, 0), // in mb + OPTION(osd_max_write_size, OPT_INT, 90), + OPTION(osd_balance_reads, OPT_BOOL, false), + OPTION(osd_flash_crowd_iat_threshold, OPT_INT, 0), + OPTION(osd_flash_crowd_iat_alpha, OPT_DOUBLE, 0.125), + OPTION(osd_shed_reads, OPT_INT, false), // forward from primary to replica + OPTION(osd_shed_reads_min_latency, OPT_DOUBLE, .01), // min local latency + OPTION(osd_shed_reads_min_latency_diff, OPT_DOUBLE, .01), // min latency difference + OPTION(osd_shed_reads_min_latency_ratio, OPT_DOUBLE, 1.5), // 1.2 == 20% higher than peer + OPTION(osd_client_message_size_cap, OPT_LONGLONG, 500*1024L*1024L), // default to 200MB client data allowed in-memory + OPTION(osd_stat_refresh_interval, OPT_DOUBLE, .5), + OPTION(osd_pg_bits, OPT_INT, 6), // bits per osd + OPTION(osd_pgp_bits, OPT_INT, 6), // bits per osd + OPTION(osd_lpg_bits, OPT_INT, 2), // bits per osd + OPTION(osd_pg_layout, OPT_INT, CEPH_PG_LAYOUT_CRUSH), + OPTION(osd_min_rep, OPT_INT, 1), + OPTION(osd_max_rep, OPT_INT, 10), + OPTION(osd_min_raid_width, OPT_INT, 3), + OPTION(osd_max_raid_width, OPT_INT, 2), + OPTION(osd_pool_default_crush_rule, OPT_INT, 0), + OPTION(osd_pool_default_size, OPT_INT, 2), + OPTION(osd_pool_default_pg_num, OPT_INT, 8), + OPTION(osd_pool_default_pgp_num, OPT_INT, 8), + OPTION(osd_op_threads, OPT_INT, 2), // 0 == no threading + OPTION(osd_max_opq, OPT_INT, 10), + OPTION(osd_disk_threads, OPT_INT, 1), + OPTION(osd_recovery_threads, OPT_INT, 1), + OPTION(osd_age, OPT_FLOAT, .8), + OPTION(osd_age_time, OPT_INT, 0), + OPTION(osd_heartbeat_interval, OPT_INT, 1), + OPTION(osd_mon_heartbeat_interval, OPT_INT, 30), // if no peers, ping monitor + OPTION(osd_heartbeat_grace, OPT_INT, 20), + OPTION(osd_mon_report_interval_max, OPT_INT, 120), + OPTION(osd_mon_report_interval_min, OPT_INT, 5), // pg stats, failures, up_thru, boot. + OPTION(osd_min_down_reporters, OPT_INT, 1), // number of OSDs who need to report a down OSD for it to count + OPTION(osd_min_down_reports, OPT_INT, 3), // number of times a down OSD must be reported for it to count + OPTION(osd_replay_window, OPT_INT, 45), + OPTION(osd_preserve_trimmed_log, OPT_BOOL, true), + OPTION(osd_recovery_delay_start, OPT_FLOAT, 15), + OPTION(osd_recovery_max_active, OPT_INT, 5), + OPTION(osd_recovery_max_chunk, OPT_LONGLONG, 1<<20), // max size of push chunk + OPTION(osd_recovery_forget_lost_objects, OPT_BOOL, false), // off for now + OPTION(osd_max_scrubs, OPT_INT, 1), + OPTION(osd_scrub_load_threshold, OPT_FLOAT, 0.5), + OPTION(osd_scrub_min_interval, OPT_FLOAT, 300), + OPTION(osd_scrub_max_interval, OPT_FLOAT, 60*60*24), // once a day + OPTION(osd_auto_weight, OPT_BOOL, false), + OPTION(osd_class_error_timeout, OPT_DOUBLE, 60.0), // seconds + OPTION(osd_class_timeout, OPT_DOUBLE, 60*60.0), // seconds + OPTION(osd_class_tmp, OPT_STR, "/var/lib/ceph/tmp"), + OPTION(osd_check_for_log_corruption, OPT_BOOL, false), + OPTION(osd_use_stale_snap, OPT_BOOL, false), + OPTION(osd_max_notify_timeout, OPT_U32, 30), // max notify timeout in seconds + OPTION(filestore, OPT_BOOL, false), + OPTION(filestore_max_sync_interval, OPT_DOUBLE, 5), // seconds + OPTION(filestore_min_sync_interval, OPT_DOUBLE, .01), // seconds + OPTION(filestore_fake_attrs, OPT_BOOL, false), + OPTION(filestore_fake_collections, OPT_BOOL, false), + OPTION(filestore_dev, OPT_STR, 0), + OPTION(filestore_btrfs_trans, OPT_BOOL, false), + OPTION(filestore_btrfs_snap, OPT_BOOL, true), + OPTION(filestore_btrfs_clone_range, OPT_BOOL, true), + OPTION(filestore_fsync_flushes_journal_data, OPT_BOOL, false), + OPTION(filestore_flusher, OPT_BOOL, true), + OPTION(filestore_flusher_max_fds, OPT_INT, 512), + OPTION(filestore_sync_flush, OPT_BOOL, false), + OPTION(filestore_journal_parallel, OPT_BOOL, false), + OPTION(filestore_journal_writeahead, OPT_BOOL, false), + OPTION(filestore_journal_trailing, OPT_BOOL, false), + OPTION(filestore_queue_max_ops, OPT_INT, 500), + OPTION(filestore_queue_max_bytes, OPT_INT, 100 << 20), + OPTION(filestore_queue_committing_max_ops, OPT_INT, 500), // this is ON TOP of filestore_queue_max_* + OPTION(filestore_queue_committing_max_bytes, OPT_INT, 100 << 20), // " + OPTION(filestore_op_threads, OPT_INT, 2), + OPTION(filestore_commit_timeout, OPT_FLOAT, 600), + OPTION(ebofs, OPT_BOOL, false), + OPTION(ebofs_cloneable, OPT_BOOL, true), + OPTION(ebofs_verify, OPT_BOOL, false), + OPTION(ebofs_commit_ms, OPT_INT, 200), // 0 = no forced commit timeout (for debugging/tracing) + OPTION(ebofs_oc_size, OPT_INT, 10000), // onode cache + OPTION(ebofs_cc_size, OPT_INT, 10000), // cnode cache + OPTION(ebofs_bc_size, OPT_LONGLONG, 50*256), // 4k blocks, *256 for MB + OPTION(ebofs_bc_max_dirty, OPT_LONGLONG, 30*256), // before write() will block + OPTION(ebofs_max_prefetch, OPT_INT, 1000), // 4k blocks + OPTION(ebofs_realloc, OPT_BOOL, false), // hrm, this can cause bad fragmentation, don't use! + OPTION(ebofs_verify_csum_on_read, OPT_BOOL, true), + OPTION(journal_dio, OPT_BOOL, true), + OPTION(journal_block_align, OPT_BOOL, true), + OPTION(journal_max_write_bytes, OPT_INT, 10 << 20), + OPTION(journal_max_write_entries, OPT_INT, 100), + OPTION(journal_queue_max_ops, OPT_INT, 500), + OPTION(journal_queue_max_bytes, OPT_INT, 100 << 20), + OPTION(journal_align_min_size, OPT_INT, 64 << 10), // align data payloads >= this. + OPTION(bdev_lock, OPT_BOOL, true), + OPTION(bdev_iothreads, OPT_INT, 1), // number of ios to queue with kernel + OPTION(bdev_idle_kick_after_ms, OPT_INT, 100), // ms + OPTION(bdev_el_fw_max_ms, OPT_INT, 10000), // restart elevator at least once every 1000 ms + OPTION(bdev_el_bw_max_ms, OPT_INT, 3000), // restart elevator at least once every 300 ms + OPTION(bdev_el_bidir, OPT_BOOL, false), // bidirectional elevator? + OPTION(bdev_iov_max, OPT_INT, 512), // max # iov's to collect into a single readv()/writev() call + OPTION(bdev_debug_check_io_overlap, OPT_BOOL, true), // [DEBUG] check for any pending io overlaps + OPTION(bdev_fake_mb, OPT_INT, 0), + OPTION(bdev_fake_max_mb, OPT_INT, 0), }; const int NUM_CONFIG_OPTIONS = sizeof(config_optionsp) / sizeof(config_option); @@ -522,7 +521,7 @@ parse_config_files(const std::list &conf_files) } } - // This bit of global fiddling needs to go somewhere else eventually. + // FIXME: This bit of global fiddling needs to go somewhere else eventually. std::string val; g_lockdep = ((get_val_from_conf_file(my_sections, "lockdep", val) == 0) && @@ -537,52 +536,20 @@ parse_env() keyring = getenv("CEPH_KEYRING"); } -// FIXME: should be folded into parse_argv -void md_config_t:: -parse_argv_part2(std::vector& args) -{ - DEFINE_CONF_VARS(NULL); - - std::vector nargs; - FOR_EACH_ARG(args) { - int optn; - - for (optn = 0; optn < NUM_CONFIG_OPTIONS; optn++) { - if (CEPH_ARGPARSE_EQ("lockdep", '\0')) { - CEPH_ARGPARSE_SET_ARG_VAL(&g_lockdep, OPT_INT); - } else if (CEPH_ARGPARSE_EQ(config_optionsp[optn].name, - config_optionsp[optn].char_option)) { - if (__isarg || val_pos || config_optionsp[optn].type == OPT_BOOL) - CEPH_ARGPARSE_SET_ARG_VAL(config_optionsp[optn].val_ptr, config_optionsp[optn].type); - else - continue; - } else { - continue; - } - break; - } - - if (optn == NUM_CONFIG_OPTIONS) - nargs.push_back(args[i]); - } - - args = nargs; -} - void md_config_t:: parse_argv(std::vector& args) { std::string val; for (std::vector::iterator i = args.begin(); i != args.end(); ) { - if (ceph_argparse_flag(args, i, "--show_conf", "-S", NULL)) { + if (ceph_argparse_flag(args, i, "--show_conf", (char*)NULL)) { cf->dump(); _exit(0); } - else if (ceph_argparse_flag(args, i, "--foreground", "-f", NULL)) { + else if (ceph_argparse_flag(args, i, "--foreground", "-f", (char*)NULL)) { daemonize = false; pid_file = ""; } - else if (ceph_argparse_flag(args, i, "-d", NULL)) { + else if (ceph_argparse_flag(args, i, "-d", (char*)NULL)) { daemonize = false; log_dir = ""; pid_file = ""; @@ -592,18 +559,55 @@ parse_argv(std::vector& args) log_to_syslog = false; log_per_instance = false; } - else if (ceph_argparse_witharg(args, i, &val, "--monmap", "-M", NULL)) { + // Some stuff that we wanted to give universal single-character options for + // Careful: you can burn through the alphabet pretty quickly by adding + // to this list. + else if (ceph_argparse_witharg(args, i, &val, "--monmap", "-M", (char*)NULL)) { monmap = val; } - else if (ceph_argparse_witharg(args, i, &val, "--bind", NULL)) { + else if (ceph_argparse_witharg(args, i, &val, "--mon_host", "-m", (char*)NULL)) { + mon_host = val; + } + else if (ceph_argparse_witharg(args, i, &val, "--bind", (char*)NULL)) { public_addr.parse(val.c_str()); } + else if (ceph_argparse_witharg(args, i, &val, "--keyfile", "-K", (char*)NULL)) { + keyfile = val; + } + else if (ceph_argparse_witharg(args, i, &val, "--keyring", "-k", (char*)NULL)) { + keyring = val; + } + else if (ceph_argparse_witharg(args, i, &val, "--client_mountpoint", "-r", (char*)NULL)) { + client_mountpoint = val; + } + else if (ceph_argparse_witharg(args, i, &val, "--lockdep", (char*)NULL)) { + // FIXME: This bit of global fiddling needs to go somewhere else eventually. + g_lockdep = + ((strcasecmp(val.c_str(), "true") == 0) || (atoi(val.c_str()) != 0)); + } else { - // ignore - ++i; + int o; + for (o = 0; o < NUM_CONFIG_OPTIONS; ++o) { + const config_option *opt = config_optionsp + o; + std::string as_option("--"); + as_option += opt->name; + if ((opt->type == OPT_BOOL) && + ceph_argparse_flag(args, i, as_option.c_str(), (char*)NULL)) { + set_val_impl("true", opt); + break; + } + else if (ceph_argparse_witharg(args, i, &val, + as_option.c_str(), (char*)NULL)) { + set_val_impl(val.c_str(), opt); + break; + } + } + if (o == NUM_CONFIG_OPTIONS) { + // ignore + ++i; + } } } - parse_argv_part2(args); } int md_config_t:: @@ -779,7 +783,7 @@ set_val_from_default(const config_option *opt) } int md_config_t:: -set_val_impl(const char *val, config_option *opt) +set_val_impl(const char *val, const config_option *opt) { switch (opt->type) { case OPT_NONE: diff --git a/src/common/config.h b/src/common/config.h index 97b6746402d18..166114c8d7549 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -82,7 +82,7 @@ private: // Private function for setting a default for a config option void set_val_from_default(const config_option *opt); - int set_val_impl(const char *val, config_option *opt); + int set_val_impl(const char *val, const config_option *opt); // Do metavariable expansions void conf_post_process_val(std::string &val) const; @@ -520,7 +520,6 @@ struct config_option { double def_double; opt_type_t type; - char char_option; // if any }; #include "common/debug.h" -- 2.39.5