diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-10-03 18:41:11 +0530 |
---|---|---|
committer | Ravishankar N <ravishankar@redhat.com> | 2017-10-09 12:19:16 +0530 |
commit | 452b9124f452d6c73f72da577a98f17502b1ed2c (patch) | |
tree | ac633133b64de4384e73c5e8f2493d0be495bfd3 /xlators/mgmt/glusterd/src/glusterd-volgen.c | |
parent | 20fa80057eb430fd72b4fa31b9b65598b8ec1265 (diff) |
glusterd : fix client io-threads option for replicate volumes
Problem:
Commit ff075a3d6f9b142911d25c27fd209838782bfff0 disabled loading
client-io-threads for replicate volumes (it was set to on by default in
commit e068c1997314046658dd502e9118dab32decf879) due to performance
issues but in doing so, inadvertently failed to load the xlator even if
the user explicitly enabled the option using the volume set command.
This was despite returning returning sucess for the volume set.
Fix:
Modify the check in perfxl_option_handler() and add checks in volume
create/add-brick/remove-brick code paths, tying it all to
GD_OP_VERSION_3_12_2.
Change-Id: Ib612973a999a7da818cc926f5c2601b1f0794fcf
BUG: 1498570
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index f65ad94ace6..f3d4d08bf05 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -2671,9 +2671,15 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, { gf_boolean_t enabled = _gf_false; glusterd_volinfo_t *volinfo = NULL; + xlator_t *this = NULL; + glusterd_conf_t *priv = NULL; - GF_ASSERT (param); + GF_VALIDATE_OR_GOTO ("glusterd", param, out); volinfo = param; + this = THIS; + GF_VALIDATE_OR_GOTO ("glusterd", this, out); + priv = this->private; + GF_VALIDATE_OR_GOTO ("glusterd", priv, out); if (strcmp (vme->option, "!perf") != 0) return 0; @@ -2689,13 +2695,15 @@ 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 (priv->op_version < GD_OP_VERSION_3_12_2) { + /* 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 @@ -2706,8 +2714,8 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, if (volgen_graph_add (graph, vme->voltype, volinfo->volname)) return 0; - else - return -1; +out: + return -1; } static int |