]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: OSDMonitor: add option 'mon_max_pool_pg_num' and limit 'pg_num' accordingly
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 17 Dec 2012 18:58:16 +0000 (18:58 +0000)
committerSage Weil <sage@inktank.com>
Mon, 17 Dec 2012 22:41:48 +0000 (14:41 -0800)
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>
src/common/config_opts.h
src/mon/OSDMonitor.cc

index bd5b733bd64efa9f8fbb28c60fc96278e669d466..6bc4b1facbf403f4c5b12d79ecc13492253645ce 100644 (file)
@@ -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)
index e893655dab68ce0e8669ddc29231ceef7a596b7e..5c8b08e43a20b3116e171057d231ec0575ef2d3d 100644 (file)
@@ -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;
         }