glusterd: fix get_mux_limit_per_process to read default value

get_mux_limit_per_process () reads the global option dictionary and in
case it doesn't find out a key, assumes that
cluster.max-bricks-per-process option isn't configured however the
default value should be picked up in such case.

Change-Id: I35dd8da084adbf59793d58557e818d8e6c17f9f3
Fixes: bz#1656951
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
This commit is contained in:
Atin Mukherjee 2018-12-06 23:14:57 +05:30
parent 9ee330aaf0
commit 916df2c12b
4 changed files with 4 additions and 10 deletions

View File

@ -85,7 +85,7 @@ glusterd_all_vol_opts valid_all_vol_opts[] = {
* can be attached per process.
* TBD: Discuss the default value for this. Maybe this should be a
* dynamic value depending on the memory specifications per node */
{GLUSTERD_BRICKMUX_LIMIT_KEY, "250"},
{GLUSTERD_BRICKMUX_LIMIT_KEY, GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE},
{GLUSTERD_LOCALTIME_LOGGING_KEY, "disable"},
{GLUSTERD_DAEMON_LOG_LEVEL_KEY, "INFO"},
{NULL},

View File

@ -139,15 +139,8 @@ get_mux_limit_per_process(int *mux_limit)
ret = dict_get_strn(priv->opts, GLUSTERD_BRICKMUX_LIMIT_KEY,
SLEN(GLUSTERD_BRICKMUX_LIMIT_KEY), &value);
if (ret) {
gf_msg_debug(this->name, 0,
"Limit for number of bricks per "
"brick process not yet set in dict. Returning "
"limit as 0 denoting that multiplexing can "
"happen with no limit set.");
ret = 0;
goto out;
value = GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE;
}
ret = gf_string2int(value, &max_bricks_per_proc);
if (ret)
goto out;

View File

@ -2803,7 +2803,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
"brick process."},
{.key = GLUSTERD_BRICKMUX_LIMIT_KEY,
.voltype = "mgmt/glusterd",
.value = "250",
.value = GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE,
.op_version = GD_OP_VERSION_3_12_0,
.validate_fn = validate_mux_limit,
.type = GLOBAL_DOC,

View File

@ -57,6 +57,7 @@
#define GLUSTERD_SHARED_STORAGE_KEY "cluster.enable-shared-storage"
#define GLUSTERD_BRICK_MULTIPLEX_KEY "cluster.brick-multiplex"
#define GLUSTERD_BRICKMUX_LIMIT_KEY "cluster.max-bricks-per-process"
#define GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE "250"
#define GLUSTERD_LOCALTIME_LOGGING_KEY "cluster.localtime-logging"
#define GLUSTERD_DAEMON_LOG_LEVEL_KEY "cluster.daemon-log-level"