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