diff options
author | Joao Eduardo Luis <joao.luis@inktank.com> | 2012-12-17 18:58:16 +0000 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-12-17 14:41:48 -0800 |
commit | bdc998ef4c6c5967e1e807584dac2f6d69bc5a5a (patch) | |
tree | 428fa103a17ef40471733bcca5eca3877d937b63 | |
parent | 4bf9078286d58c2cd4e85cb8b31411220a377092 (diff) | |
download | ceph-bdc998ef4c6c5967e1e807584dac2f6d69bc5a5a.tar.gz |
mon: OSDMonitor: add option 'mon_max_pool_pg_num' and limit 'pg_num' accordingly
Instead of having a hardcoded default, use a configurable one. It is
limited to 65536 until future testing guarantees there is no side-effects
of increasing it past this value, but by being adjustable the user still
has the freedom to specify whatever maximum value he wants.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r-- | src/common/config_opts.h | 1 | ||||
-rw-r--r-- | src/mon/OSDMonitor.cc | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h index bd5b733bd64..6bc4b1facbf 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -163,6 +163,7 @@ 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(mon_client_max_log_entries_per_message, OPT_INT, 1000) +OPTION(mon_max_pool_pg_num, OPT_INT, 65536) OPTION(client_cache_size, OPT_INT, 16384) OPTION(client_cache_mid, OPT_FLOAT, .75) OPTION(client_use_random_mds, OPT_BOOL, false) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e893655dab6..5c8b08e43a2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2624,10 +2624,11 @@ bool OSDMonitor::prepare_command(MMonCommand *m) int pg_num = 0; int pgp_num = 0; - /* Don't allow over 65535 pgs in a single pool */ pg_num = parse_pos_long(m->cmd[4].c_str(), &ss); - if ((pg_num == 0) || (pg_num > 65535)) { - ss << "'pg_num' must be greater than 0 and lower or equal than 65535"; + if ((pg_num == 0) || (pg_num > g_conf->mon_max_pool_pg_num)) { + ss << "'pg_num' must be greater than 0 and less than or equal to " + << g_conf->mon_max_pool_pg_num + << " (you may adjust 'mon max pool pg num' for higher values)"; err = -ERANGE; goto out; } |