e7a346
From 2a80ccb39ea7f4ef5c801ad78b43e4bdc23a3c64 Mon Sep 17 00:00:00 2001
e7a346
From: Atin Mukherjee <amukherj@redhat.com>
e7a346
Date: Fri, 2 Feb 2018 15:38:58 +0530
e7a346
Subject: [PATCH 138/139] glusterd: enable brick multiplexing by default
e7a346
e7a346
Label: DOWNSTREAM ONLY
e7a346
e7a346
Change-Id: I0d9a1d8ba2fd60576df9761b5faaa521e9228be0
e7a346
BUG: 1540011
e7a346
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/129382
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Mohit Agrawal <moagrawa@redhat.com>
e7a346
---
e7a346
 cli/src/cli-cmd-parser.c                        | 18 ------------------
e7a346
 xlators/mgmt/glusterd/src/glusterd-op-sm.c      |  2 +-
e7a346
 xlators/mgmt/glusterd/src/glusterd-utils.c      |  2 +-
e7a346
 xlators/mgmt/glusterd/src/glusterd-volume-set.c |  2 +-
e7a346
 4 files changed, 3 insertions(+), 21 deletions(-)
e7a346
e7a346
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
e7a346
index 764f420..54bd57f 100644
e7a346
--- a/cli/src/cli-cmd-parser.c
e7a346
+++ b/cli/src/cli-cmd-parser.c
e7a346
@@ -1740,24 +1740,6 @@ cli_cmd_volume_set_parse (struct cli_state *state, const char **words,
e7a346
                                 goto out;
e7a346
                         }
e7a346
                 }
e7a346
-
e7a346
-                if ((strcmp (key, "cluster.brick-multiplex") == 0)) {
e7a346
-                        question = "Brick-multiplexing is supported only for "
e7a346
-                                   "container workloads (CNS/CRS). Also it is "
e7a346
-                                   "advised to make sure that either all "
e7a346
-                                   "volumes are in stopped state or no bricks "
e7a346
-                                   "are running before this option is modified."
e7a346
-                                   "Do you still want to continue?";
e7a346
-
e7a346
-                        answer = cli_cmd_get_confirmation (state, question);
e7a346
-                        if (GF_ANSWER_NO == answer) {
e7a346
-                                gf_log ("cli", GF_LOG_ERROR, "Operation "
e7a346
-                                        "cancelled, exiting");
e7a346
-                                *op_errstr = gf_strdup ("Aborted by user.");
e7a346
-                                ret = -1;
e7a346
-                                goto out;
e7a346
-                        }
e7a346
-                }
e7a346
         }
e7a346
 
e7a346
         ret = dict_set_int32 (dict, "count", wordcount-3);
e7a346
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
e7a346
index b1a6e06..2fc2e3b 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
e7a346
@@ -78,7 +78,7 @@ glusterd_all_vol_opts valid_all_vol_opts[] = {
e7a346
          * TBD: add a dynamic handler to set the appropriate value
e7a346
          */
e7a346
         { GLUSTERD_MAX_OP_VERSION_KEY,          "BUG_NO_MAX_OP_VERSION"},
e7a346
-        { GLUSTERD_BRICK_MULTIPLEX_KEY,         "disable"},
e7a346
+        { GLUSTERD_BRICK_MULTIPLEX_KEY,         "enable"},
e7a346
         /* Set this value to 0 by default implying brick-multiplexing
e7a346
          * behaviour with no limit set on the number of brick instances that
e7a346
          * can be attached per process.
e7a346
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
e7a346
index f1b365f..4bb54db 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
e7a346
@@ -114,7 +114,7 @@ is_brick_mx_enabled (void)
e7a346
         if (!ret)
e7a346
                 ret = gf_string2boolean (value, &enabled);
e7a346
 
e7a346
-        return ret ? _gf_false: enabled;
e7a346
+        return ret ? _gf_true : enabled;
e7a346
 }
e7a346
 
e7a346
 int
e7a346
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
e7a346
index c255be0..693c917 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
e7a346
@@ -3459,7 +3459,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
e7a346
         /* Brick multiplexing options */
e7a346
         { .key         = GLUSTERD_BRICK_MULTIPLEX_KEY,
e7a346
           .voltype     = "mgmt/glusterd",
e7a346
-          .value       = "off",
e7a346
+          .value       = "on",
e7a346
           .op_version  = GD_OP_VERSION_3_10_0,
e7a346
           .validate_fn = validate_boolean,
e7a346
           .type        = GLOBAL_DOC,
e7a346
-- 
e7a346
1.8.3.1
e7a346