From ff075a3d6f9b142911d25c27fd209838782bfff0 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Wed, 1 Feb 2017 15:04:08 +0530 Subject: 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. Change-Id: Ibc576d4517da23fcdf55c6f4d17b90152a8817d7 BUG: 1418014 Signed-off-by: Atin Mukherjee Reviewed-on: https://review.gluster.org/16502 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Prashanth Pai Reviewed-by: Ravishankar N Reviewed-by: Jeff Darcy --- xlators/mgmt/glusterd/src/glusterd-handler.c | 4 ++-- xlators/mgmt/glusterd/src/glusterd-utils.c | 20 +++++++++++++++++++- xlators/mgmt/glusterd/src/glusterd-utils.h | 3 ++- xlators/mgmt/glusterd/src/glusterd-volgen.c | 8 ++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index b6f0197aa19..40f5704b698 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -4895,7 +4895,7 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict) (dict, _gf_false, key, orig_key, - volinfo->dict, + volinfo, &rsp.op_errstr); if (ret && !rsp.op_errstr) { snprintf (err_str, @@ -4921,7 +4921,7 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict) } else { /* Handle the "all" volume option request */ ret = glusterd_get_default_val_for_volopt (dict, _gf_true, NULL, - NULL, volinfo->dict, + NULL, volinfo, &rsp.op_errstr); if (ret && !rsp.op_errstr) { snprintf (err_str, sizeof(err_str), diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6f12a34d624..c7ea074e5f8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -11983,7 +11983,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; @@ -11994,6 +11995,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); @@ -12001,6 +12003,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 */ @@ -12022,6 +12025,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 { @@ -12034,6 +12051,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); diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index a9aefb85246..5986b9bf4fd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -699,7 +699,8 @@ glusterd_get_global_options_for_all_vols (rpcsvc_request_t *req, dict_t *dict, int glusterd_get_default_val_for_volopt (dict_t *dict, gf_boolean_t all_opts, char *key, char *orig_key, - dict_t *vol_dict, char **err_str); + glusterd_volinfo_t *volinfo, + char **err_str); int glusterd_check_client_op_version_support (char *volname, uint32_t op_version, diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 957bbfcee25..df68aa52922 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -2654,6 +2654,14 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, (vme->op_version > volinfo->client_op_version)) return 0; + /* For replicate volumes do not load io-threads as it affects + * performance + */ + if (!strcmp (vme->key, "performance.client-io-threads") && + (GF_CLUSTER_TYPE_STRIPE_REPLICATE == volinfo->type || + GF_CLUSTER_TYPE_REPLICATE == volinfo->type)) + return 0; + /* if VKEY_READDIR_AHEAD is enabled and parallel readdir is * not enabled then load readdir-ahead here else it will be * loaded as a child of dht */ -- cgit