summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-02-01 15:04:08 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-06 09:53:33 -0500
commit4c919ed5311dac4d135b5f9d1e682a9b3ef8ffbb (patch)
tree32f1512d2bb4fede9627e8b6cf28bd1bf1dd436b /xlators/mgmt/glusterd/src/glusterd-utils.c
parentec97f170a21e8b9408749590c044245713935198 (diff)
glusterd : do not load io-threads in client graph for replicate volumes
client.io-threads has been turned on by default from release-3.9 onwards, however this has an adverse effects on replicate volumes due to the design limitations on replications, till that gets addressed through server side replication as a preventive measure it is wiser not to load io-threads in the client graph for replicate volumes. >Reviewed-on: https://review.gluster.org/16502 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Smoke: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Prashanth Pai <ppai@redhat.com> >Reviewed-by: Ravishankar N <ravishankar@redhat.com> >Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Change-Id: Ibc576d4517da23fcdf55c6f4d17b90152a8817d7 BUG: 1419305 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/16545 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index cb9f040c5f7..561bbb4af5b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -11940,7 +11940,8 @@ out:
int
glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
char *input_key, char *orig_key,
- dict_t *vol_dict, char **op_errstr)
+ glusterd_volinfo_t *volinfo,
+ char **op_errstr)
{
struct volopt_map_entry *vme = NULL;
int ret = -1;
@@ -11951,6 +11952,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
char dict_key[50] = {0,};
gf_boolean_t key_found = _gf_false;
glusterd_conf_t *priv = NULL;
+ dict_t *vol_dict = NULL;
this = THIS;
GF_ASSERT (this);
@@ -11958,6 +11960,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
priv = this->private;
GF_VALIDATE_OR_GOTO (this->name, priv, out);
+ vol_dict = volinfo->dict;
GF_VALIDATE_OR_GOTO (this->name, vol_dict, out);
/* Check whether key is passed for a single option */
@@ -11979,6 +11982,20 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
if (!def_val) {
ret = dict_get_str (vol_dict, vme->key, &def_val);
if (!def_val) {
+ /* For replicate volumes
+ * performance.client-io-threads will be set to
+ * off by default until explicitly turned on
+ */
+ if (!strcmp (vme->key,
+ "performance.client-io-threads")) {
+ if (volinfo->type ==
+ GF_CLUSTER_TYPE_REPLICATE ||
+ volinfo->type ==
+ GF_CLUSTER_TYPE_STRIPE_REPLICATE) {
+ def_val = "off";
+ goto set_count;
+ }
+ }
if (vme->value) {
def_val = vme->value;
} else {
@@ -11991,6 +12008,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts,
}
}
}
+set_count:
count++;
sprintf (dict_key, "key%d", count);
ret = dict_set_str(ctx, dict_key, vme->key);