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