summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2018-12-06 23:14:57 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-12-07 07:08:58 +0000
commit916df2c12b19ac84b7806d31226d7f832ca7e2bb (patch)
tree5e7fbbce75c117c07cb45a51ce365e46f94205f9 /xlators/mgmt
parent9ee330aaf0831bc04e2ed72c05be0701571b5294 (diff)
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>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h1
4 files changed, 4 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index c43674d3845..6495a9d88c6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -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},
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 477e086509c..8466270eb5c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -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;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 70ee244d51b..39e31a295da 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -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,
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 75ca9fe367f..6e616f1ef8c 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -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"