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