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