From 4225e2f6c9f69682d0e7288d7809851b61a17c70 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Mon, 23 Jun 2014 22:41:35 +0100 Subject: [PATCH] osd: remove OSD-specific leveldb options OSDs will now rely on 'leveldb_*' config options. We do keep however leveldb's log enabled for OSDs by passing 'leveldb_log=""' as a default argument to global_init() on ceph_osd.cc -- however, users will be able to override this at their own discretion. Signed-off-by: Joao Eduardo Luis --- PendingReleaseNotes | 12 ++++++++---- src/ceph_osd.cc | 7 ++++++- src/common/config_opts.h | 8 -------- src/os/FileStore.cc | 16 ---------------- 4 files changed, 14 insertions(+), 29 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index c81d428c4047b..5e3741f9b70a0 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -2,13 +2,17 @@ v0.82 ----- -- mon-specific leveldb options have been removed. From this point onward, - users should use 'leveldb_' generic options and add the options in the - appropriate sections of their configuration files. - The monitors will still maintain the following monitor-specific defaults: +- mon-specific and osd-specific leveldb options have been removed. + From this point onward users should use 'leveldb_' generic options and add + the options in the appropriate sections of their configuration files. + Monitors will still maintain the following monitor-specific defaults: leveldb_write_buffer_size = 32*1024*1024 = 33554432 // 32MB leveldb_cache_size = 512*1024*1204 = 536870912 // 512MB leveldb_block_size = 64*1024 = 65536 // 64KB leveldb_compression = false leveldb_log = "" + + OSDs will still maintain the following osd-specific defaults: + + leveldb_log = "" diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 029ef28c40565..24587add0e126 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -72,7 +72,12 @@ int main(int argc, const char **argv) argv_to_vec(argc, argv, args); env_to_vec(args); - global_init(NULL, args, CEPH_ENTITY_TYPE_OSD, CODE_ENVIRONMENT_DAEMON, 0); + vector def_args; + // We want to enable leveldb's log, while allowing users to override this + // option, therefore we will pass it as a default argument to global_init(). + def_args.push_back("--leveldb-log="); + + global_init(&def_args, args, CEPH_ENTITY_TYPE_OSD, CODE_ENVIRONMENT_DAEMON, 0); ceph_heap_profiler_init(); // osd specific args diff --git a/src/common/config_opts.h b/src/common/config_opts.h index b11884cd3aa3a..c339882877757 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -545,14 +545,6 @@ OPTION(osd_op_history_duration, OPT_U32, 600) // Oldest completed op to track OPTION(osd_target_transaction_size, OPT_INT, 30) // to adjust various transactions that batch smaller items OPTION(osd_failsafe_full_ratio, OPT_FLOAT, .97) // what % full makes an OSD "full" (failsafe) OPTION(osd_failsafe_nearfull_ratio, OPT_FLOAT, .90) // what % full makes an OSD near full (failsafe) -OPTION(osd_leveldb_write_buffer_size, OPT_U64, 0) // OSD's leveldb write buffer size -OPTION(osd_leveldb_cache_size, OPT_U64, 0) // OSD's leveldb cache size -OPTION(osd_leveldb_block_size, OPT_U64, 0) // OSD's leveldb block size -OPTION(osd_leveldb_bloom_size, OPT_INT, 0) // OSD's leveldb bloom bits per entry -OPTION(osd_leveldb_max_open_files, OPT_INT, 0) // OSD's leveldb max open files -OPTION(osd_leveldb_compression, OPT_BOOL, true) // OSD's leveldb uses compression -OPTION(osd_leveldb_paranoid, OPT_BOOL, false) // OSD's leveldb paranoid flag -OPTION(osd_leveldb_log, OPT_STR, "") // enable OSD leveldb log file // determines whether PGLog::check() compares written out log to stored log OPTION(osd_debug_pg_log_writeout, OPT_BOOL, false) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 092ad22cd849d..8840124bb0153 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -1352,22 +1352,6 @@ int FileStore::mount() LevelDBStore *omap_store = new LevelDBStore(g_ceph_context, omap_dir); omap_store->init(); - if (g_conf->osd_leveldb_write_buffer_size) - omap_store->options.write_buffer_size = g_conf->osd_leveldb_write_buffer_size; - if (g_conf->osd_leveldb_cache_size) - omap_store->options.cache_size = g_conf->osd_leveldb_cache_size; - if (g_conf->osd_leveldb_block_size) - omap_store->options.block_size = g_conf->osd_leveldb_block_size; - if (g_conf->osd_leveldb_bloom_size) - omap_store->options.bloom_size = g_conf->osd_leveldb_bloom_size; - if (g_conf->osd_leveldb_compression) - omap_store->options.compression_enabled = g_conf->osd_leveldb_compression; - if (g_conf->osd_leveldb_paranoid) - omap_store->options.paranoid_checks = g_conf->osd_leveldb_paranoid; - if (g_conf->osd_leveldb_max_open_files) - omap_store->options.max_open_files = g_conf->osd_leveldb_max_open_files; - if (g_conf->osd_leveldb_log.length()) - omap_store->options.log_file = g_conf->osd_leveldb_log; stringstream err; if (omap_store->create_and_open(err)) { -- 2.39.5