e7a346
From 699f3c720d340b95177c521037c1cb8799930b9e Mon Sep 17 00:00:00 2001
e7a346
From: N Balachandran <nbalacha@redhat.com>
e7a346
Date: Fri, 16 Mar 2018 20:54:15 +0530
e7a346
Subject: [PATCH 208/212] cluster/dht: enable lookup-optimize by default
e7a346
e7a346
Lookup-optimize has been shown to improve create
e7a346
performance. The code has been in the project for several
e7a346
years and is considered stable.
e7a346
e7a346
Enabling this by default in order to test this in the
e7a346
upstream regression runs.
e7a346
e7a346
upstream master:https://review.gluster.org/#/c/19731/
e7a346
e7a346
> Change-Id: Iab792979ee34f0af4713931e0b5b399c23f65313
e7a346
> updates: bz#1557435
e7a346
> BUG: 1557435
e7a346
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
e7a346
e7a346
Change-Id: I076b4e4beb9db390f619f38bf4598589b95685c7
e7a346
BUG: 1557365
e7a346
Signed-off-by: N Balachandran <nbalacha@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/134450
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
e7a346
---
e7a346
 tests/features/unhashed-auto.t          | 2 +-
e7a346
 xlators/cluster/dht/src/dht-rebalance.c | 4 +++-
e7a346
 xlators/cluster/dht/src/dht-shared.c    | 2 +-
e7a346
 3 files changed, 5 insertions(+), 3 deletions(-)
e7a346
e7a346
diff --git a/tests/features/unhashed-auto.t b/tests/features/unhashed-auto.t
e7a346
index ddebd03..0a6bbfb 100755
e7a346
--- a/tests/features/unhashed-auto.t
e7a346
+++ b/tests/features/unhashed-auto.t
e7a346
@@ -114,7 +114,7 @@ TEST [ x"$new_hash" = x"00000001" ]
e7a346
 
e7a346
 # Unset the option and check that newly created directories get 1 in the
e7a346
 # disk layout
e7a346
-TEST $CLI volume reset $V0 cluster.lookup-optimize
e7a346
+TEST $CLI volume set $V0 cluster.lookup-optimize off
e7a346
 TEST mkdir $M0/dir1
e7a346
 new_hash=$(get_xattr_hash $B0/${V0}1/dir1)
e7a346
 TEST [ x"$new_hash" = x"00000001" ]
e7a346
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
e7a346
index 9770359..9e31ff8 100644
e7a346
--- a/xlators/cluster/dht/src/dht-rebalance.c
e7a346
+++ b/xlators/cluster/dht/src/dht-rebalance.c
e7a346
@@ -4422,7 +4422,9 @@ gf_defrag_start_crawl (void *data)
e7a346
 
e7a346
         ret = syncop_setxattr (this, &loc, fix_layout, 0, NULL, NULL);
e7a346
         if (ret) {
e7a346
-                gf_log (this->name, GF_LOG_ERROR, "fix layout on %s failed",
e7a346
+                gf_log (this->name, GF_LOG_ERROR,
e7a346
+                        "Failed to set commit hash on %s. "
e7a346
+                        "Rebalance cannot proceed.",
e7a346
                         loc.path);
e7a346
                 defrag->total_failures++;
e7a346
                 ret = -1;
e7a346
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
e7a346
index 42daff0..2f0d8ce 100644
e7a346
--- a/xlators/cluster/dht/src/dht-shared.c
e7a346
+++ b/xlators/cluster/dht/src/dht-shared.c
e7a346
@@ -943,7 +943,7 @@ struct volume_options options[] = {
e7a346
         },
e7a346
         { .key = {"lookup-optimize"},
e7a346
           .type = GF_OPTION_TYPE_BOOL,
e7a346
-          .default_value = "off",
e7a346
+          .default_value = "on",
e7a346
           .description = "This option if set to ON enables the optimization "
e7a346
           "of -ve lookups, by not doing a lookup on non-hashed subvolumes for "
e7a346
           "files, in case the hashed subvolume does not return any result. "
e7a346
-- 
e7a346
1.8.3.1
e7a346