From 452b9124f452d6c73f72da577a98f17502b1ed2c Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Tue, 3 Oct 2017 18:41:11 +0530 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index fdb6014bb63..6d17ff4e32d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1432,6 +1432,24 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count, /* Gets changed only if the options are given in add-brick cli */ if (type) volinfo->type = type; + /* performance.client-io-threads is turned on by default, + * however this has adverse effects on replicate volumes due to + * replication design issues, till that get addressed + * performance.client-io-threads option is turned off for all + * replicate volumes if not already explicitly enabled. + */ + if (type && glusterd_is_volume_replicate (volinfo) && + conf->op_version >= GD_OP_VERSION_3_12_2) { + ret = dict_set_str (volinfo->dict, + "performance.client-io-threads", + "off"); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_DICT_SET_FAILED, "Failed to set " + "performance.client-io-threads to off"); + goto out; + } + } if (replica_count) { volinfo->replica_count = replica_count; @@ -2713,9 +2731,12 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) char *cold_shd_key = NULL; char *hot_shd_key = NULL; int delete_key = 1; + glusterd_conf_t *conf = NULL; this = THIS; GF_ASSERT (this); + conf = this->private; + GF_VALIDATE_OR_GOTO (this->name, conf, out); ret = dict_get_str (dict, "volname", &volname); @@ -3005,6 +3026,19 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) volinfo->subvol_count = (volinfo->brick_count / volinfo->dist_leaf_count); + if (!glusterd_is_volume_replicate (volinfo) && + conf->op_version >= GD_OP_VERSION_3_12_2) { + ret = dict_set_str (volinfo->dict, + "performance.client-io-threads", + "on"); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_DICT_SET_FAILED, "Failed to set " + "performance.client-io-threads to on"); + goto out; + } + } + ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { gf_msg (this->name, GF_LOG_WARNING, 0, -- cgit