summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-10-09 17:46:16 +0530
committerRavishankar N <ravishankar@redhat.com>2017-10-09 17:51:08 +0530
commit47604fad4c2a3951077e41e0c007ceb979bb2c24 (patch)
tree4cf022745c771a8e01abeed7ec704c8a68529103 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parent5f4aa8c21d10b25aa1322a96d3bca3c7499075eb (diff)
glusterd: fix client io-threads option for replicate volumes
Backport of https://review.gluster.org/#/c/18430/ 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: 1499158 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index 9ce600e51c3..9d340738452 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -2231,6 +2231,23 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr)
volinfo->stripe_count = 1;
if (GF_CLUSTER_TYPE_REPLICATE == volinfo->type) {
+ /* performance.client-io-threads is turned on to 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 (priv->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;
+ }
+ }
ret = dict_get_int32 (dict, "replica-count",
&volinfo->replica_count);
if (ret) {
@@ -2251,6 +2268,23 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr)
goto out;
}
} else if (GF_CLUSTER_TYPE_STRIPE_REPLICATE == volinfo->type) {
+ /* performance.client-io-threads is turned on to 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 (priv->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;
+ }
+ }
ret = dict_get_int32 (dict, "stripe-count",
&volinfo->stripe_count);
if (ret) {