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