Merge commit '4225e2f6c9f69682d0e7288d7809851b61a17c70'

Conflicts:
	PendingReleaseNotes

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-06-25 11:05:50 -07:00
commit 4958786c6a
7 changed files with 49 additions and 59 deletions

View File

@ -6,3 +6,17 @@ v0.82
change that prevents existing OSD data from being upgraded. This
affects developers and testers only.
* 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 = ""

View File

@ -198,6 +198,28 @@ int main(int argc, const char **argv)
argv_to_vec(argc, argv, args);
env_to_vec(args);
// We need to specify some default values that may be overridden by the
// user, that are specific to the monitor. The options we are overriding
// are also used on the OSD (or in any other component that uses leveldb),
// so changing them directly in common/config_opts.h is not an option.
// This is not the prettiest way of doing this, especially since it has us
// having a different place than common/config_opts.h defining default
// values, but it's not horribly wrong enough to prevent us from doing it :)
//
// NOTE: user-defined options will take precedence over ours.
//
// 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 = ""
vector<const char*> def_args;
def_args.push_back("--leveldb-write-buffer-size=33554432");
def_args.push_back("--leveldb-cache-size=536870912");
def_args.push_back("--leveldb-block-size=65536");
def_args.push_back("--leveldb-compression=false");
def_args.push_back("--leveldb-log=");
int flags = 0;
{
vector<const char*> args_copy = args;
@ -218,7 +240,8 @@ int main(int argc, const char **argv)
}
}
global_init(NULL, args, CEPH_ENTITY_TYPE_MON, CODE_ENVIRONMENT_DAEMON, flags);
global_init(&def_args, args,
CEPH_ENTITY_TYPE_MON, CODE_ENVIRONMENT_DAEMON, flags);
uuid_d fsid;
std::string val;

View File

@ -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<const char*> 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

View File

@ -191,6 +191,7 @@ OPTION(mon_max_log_entries_per_event, OPT_INT, 4096)
OPTION(mon_health_data_update_interval, OPT_FLOAT, 60.0)
OPTION(mon_data_avail_crit, OPT_INT, 5)
OPTION(mon_data_avail_warn, OPT_INT, 30)
OPTION(mon_data_size_warn, OPT_U64, 15*1024*1024*1024) // issue a warning when the monitor's data store goes over 15GB (in bytes)
OPTION(mon_config_key_max_entry_size, OPT_INT, 4096) // max num bytes per config-key entry
OPTION(mon_sync_timeout, OPT_DOUBLE, 60.0)
OPTION(mon_sync_max_payload_size, OPT_U32, 1048576) // max size for a sync chunk payload (say, 1MB)
@ -211,15 +212,6 @@ OPTION(mon_debug_dump_location, OPT_STR, "/var/log/ceph/$cluster-$name.tdump")
OPTION(mon_sync_provider_kill_at, OPT_INT, 0) // kill the sync provider at a specific point in the work flow
OPTION(mon_sync_requester_kill_at, OPT_INT, 0) // kill the sync requester at a specific point in the work flow
OPTION(mon_leveldb_write_buffer_size, OPT_U64, 32*1024*1024) // monitor's leveldb write buffer size
OPTION(mon_leveldb_cache_size, OPT_U64, 512*1024*1024) // monitor's leveldb cache size
OPTION(mon_leveldb_block_size, OPT_U64, 64*1024) // monitor's leveldb block size
OPTION(mon_leveldb_bloom_size, OPT_INT, 0) // monitor's leveldb bloom bits per entry
OPTION(mon_leveldb_max_open_files, OPT_INT, 0) // monitor's leveldb max open files
OPTION(mon_leveldb_compression, OPT_BOOL, false) // monitor's leveldb uses compression
OPTION(mon_leveldb_paranoid, OPT_BOOL, false) // monitor's leveldb paranoid flag
OPTION(mon_leveldb_log, OPT_STR, "")
OPTION(mon_leveldb_size_warn, OPT_U64, 40*1024*1024*1024) // issue a warning when the monitor's leveldb goes over 40GB (in bytes)
OPTION(mon_force_quorum_join, OPT_BOOL, false) // force monitor to join quorum even if it has been previously removed from the map
OPTION(paxos_stash_full_interval, OPT_INT, 25) // how often (in commits) to stash a full copy of the PaxosService state
OPTION(paxos_max_join_drift, OPT_INT, 10) // max paxos iterations before we must first sync the monitor stores
@ -561,14 +553,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)

View File

@ -94,7 +94,7 @@ void DataHealthService::get_health(
health_detail = "low disk space";
}
if (stats.store_stats.bytes_total >= g_conf->mon_leveldb_size_warn) {
if (stats.store_stats.bytes_total >= g_conf->mon_data_size_warn) {
if (health_status > HEALTH_WARN)
health_status = HEALTH_WARN;
if (!health_detail.empty())
@ -102,7 +102,7 @@ void DataHealthService::get_health(
stringstream ss;
ss << "store is getting too big! "
<< prettybyte_t(stats.store_stats.bytes_total)
<< " >= " << prettybyte_t(g_conf->mon_leveldb_size_warn);
<< " >= " << prettybyte_t(g_conf->mon_data_size_warn);
health_detail.append(ss.str());
}

View File

@ -486,33 +486,13 @@ class MonitorDBStore
db->submit_transaction_sync(dbt);
}
void init_options() {
db->init();
if (g_conf->mon_leveldb_write_buffer_size)
db->options.write_buffer_size = g_conf->mon_leveldb_write_buffer_size;
if (g_conf->mon_leveldb_cache_size)
db->options.cache_size = g_conf->mon_leveldb_cache_size;
if (g_conf->mon_leveldb_block_size)
db->options.block_size = g_conf->mon_leveldb_block_size;
if (g_conf->mon_leveldb_bloom_size)
db->options.bloom_size = g_conf->mon_leveldb_bloom_size;
if (g_conf->mon_leveldb_compression)
db->options.compression_enabled = g_conf->mon_leveldb_compression;
if (g_conf->mon_leveldb_max_open_files)
db->options.max_open_files = g_conf->mon_leveldb_max_open_files;
if (g_conf->mon_leveldb_paranoid)
db->options.paranoid_checks = g_conf->mon_leveldb_paranoid;
if (g_conf->mon_leveldb_log.length())
db->options.log_file = g_conf->mon_leveldb_log;
}
int open(ostream &out) {
init_options();
db->init();
return db->open(out);
}
int create_and_open(ostream &out) {
init_options();
db->init();
return db->create_and_open(out);
}

View File

@ -1360,22 +1360,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)) {