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