summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-04-28 22:42:14 +0530
committerKaushal M <kaushal@redhat.com>2015-05-06 05:05:18 -0700
commitd17b72165e2280ead15f1c5fed061ce901f093cc (patch)
tree97899e1c1ff0db6af7cdc69a9a62358f6307068d
parentdbf1ea8be8cc21787cfab9fa62ce7b48356705ec (diff)
glusterd: Enable readdir-ahead by default on new volumes
With gluster-3.7, 'performance.readdir-ahead' will be enabled by default on new volumes when the cluster op-version supports it. Change-Id: I44e76a69e7d1c11e6dfad72c941caf887bb810ee BUG: 1217135 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/10450 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--tests/bugs/cli/bug-1022905.t3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c18
2 files changed, 17 insertions, 4 deletions
diff --git a/tests/bugs/cli/bug-1022905.t b/tests/bugs/cli/bug-1022905.t
index f9f7f3c6163..1d8981e0e9c 100644
--- a/tests/bugs/cli/bug-1022905.t
+++ b/tests/bugs/cli/bug-1022905.t
@@ -24,9 +24,6 @@ TEST $CLI volume set $V0 diagnostics.client-log-level DEBUG
## Reset cmd resets only unprotected option(s), succeeds.
TEST $CLI volume reset $V0;
-## Reset should fail
-TEST ! $CLI volume reset $V0;
-
## Set an unprotected option
TEST $CLI volume set $V0 diagnostics.client-log-level DEBUG
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index f162bbed64c..6a2757172be 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -9113,7 +9113,7 @@ glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option)
conf = this->private;
GF_ASSERT (conf);
- if (conf->op_version >= GD_OP_VERSION_3_6_0) {
+ if (conf->op_version >= GD_OP_VERSION_3_7_0) {
/* Set needed volume options in volinfo->dict
* For ex.,
*
@@ -9122,6 +9122,22 @@ glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option)
* ...
* }
* */
+
+ /* readdir-ahead needs to be enabled for new volumes with
+ * >= gluster version 3.7
+ */
+ if (!option || !strcmp ("performance.readdir-ahead", option)) {
+ ret = dict_set_dynstr_with_alloc (volinfo->dict,
+ "performance.readdir-ahead", "on");
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Failed to set option "
+ "'performance.readdir-ahead' on volume "
+ "%s", volinfo->volname);
+ goto out;
+ }
+ }
+
}
out:
return ret;