f338ef
From c44c9f2003b703d64a2a06c53f5a2b85e9dc7a11 Mon Sep 17 00:00:00 2001
f338ef
From: Kotresh HR <khiremat@redhat.com>
f338ef
Date: Wed, 31 Jul 2019 09:23:42 -0400
f338ef
Subject: [PATCH 262/262] glusterd/ctime: Disable ctime by default
f338ef
f338ef
The ctime feature, in combination with gfid2path
f338ef
causes peformance dip on rename workloads. Hence
f338ef
disabling the feature by default.
f338ef
f338ef
Change-Id: I280527eea4dc19bba39fb6a5e74760823a056dc9
f338ef
Label : DOWNSTREAM ONLY
f338ef
BUG: 1713890
f338ef
Signed-off-by: Kotresh HR <khiremat@redhat.com>
f338ef
Reviewed-on: https://code.engineering.redhat.com/gerrit/177421
f338ef
Tested-by: RHGS Build Bot <nigelb@redhat.com>
f338ef
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
f338ef
Reviewed-by: Amar Tumballi Suryanarayan <amarts@redhat.com>
f338ef
---
f338ef
 xlators/mgmt/glusterd/src/glusterd-volgen.c     | 10 +++++++---
f338ef
 xlators/mgmt/glusterd/src/glusterd-volume-set.c |  2 +-
f338ef
 xlators/storage/posix/src/posix-common.c        |  2 +-
f338ef
 3 files changed, 9 insertions(+), 5 deletions(-)
f338ef
f338ef
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
f338ef
index 5e0214e..539e8a5 100644
f338ef
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
f338ef
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
f338ef
@@ -4382,14 +4382,18 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
f338ef
             goto out;
f338ef
         }
f338ef
     }
f338ef
-    /* a. ret will be -1 if features.ctime is not set in the volinfo->dict which
f338ef
-     * means ctime should be loaded into the graph.
f338ef
+    /* a. ret will be 0 (returned default) if features.ctime is not set
f338ef
+     * in the volinfo->dict which means ctime should not be loaded into
f338ef
+     * the graph. It is disabled by default.
f338ef
      * b. ret will be 1 if features.ctime is explicitly turned on through
f338ef
      * volume set and in that case ctime should be loaded into the graph.
f338ef
      * c. ret will be 0 if features.ctime is explicitly turned off and in that
f338ef
      * case ctime shouldn't be loaded into the graph.
f338ef
      */
f338ef
-    ret = dict_get_str_boolean(set_dict, "features.ctime", -1);
f338ef
+    ret = dict_get_str_boolean(set_dict, "features.ctime", 0);
f338ef
+    if (ret == -1)
f338ef
+        goto out;
f338ef
+
f338ef
     if (conf->op_version >= GD_OP_VERSION_5_0 && ret) {
f338ef
         xl = volgen_graph_add(graph, "features/utime", volname);
f338ef
         if (!xl) {
f338ef
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
f338ef
index 7a83124..8ce338e 100644
f338ef
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
f338ef
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
f338ef
@@ -3680,7 +3680,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
f338ef
     {.key = "features.ctime",
f338ef
      .voltype = "features/utime",
f338ef
      .validate_fn = validate_boolean,
f338ef
-     .value = "on",
f338ef
+     .value = "off",
f338ef
      .option = "!utime",
f338ef
      .op_version = GD_OP_VERSION_4_1_0,
f338ef
      .description = "enable/disable utime translator on the volume.",
f338ef
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
f338ef
index bfe2cb0..d738692 100644
f338ef
--- a/xlators/storage/posix/src/posix-common.c
f338ef
+++ b/xlators/storage/posix/src/posix-common.c
f338ef
@@ -1374,7 +1374,7 @@ struct volume_options posix_options[] = {
f338ef
                     "SHA256 checksum. MD5 otherwise."},
f338ef
     {.key = {"ctime"},
f338ef
      .type = GF_OPTION_TYPE_BOOL,
f338ef
-     .default_value = "on",
f338ef
+     .default_value = "off",
f338ef
      .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
f338ef
      .op_version = {GD_OP_VERSION_4_1_0},
f338ef
      .tags = {"ctime"},
f338ef
-- 
f338ef
1.8.3.1
f338ef