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