e7a346
From bc7cc384c82ba8c0bc083ff70b5f2506acfd2b43 Mon Sep 17 00:00:00 2001
e7a346
From: Atin Mukherjee <amukherj@redhat.com>
e7a346
Date: Mon, 13 Aug 2018 20:30:04 +0530
e7a346
Subject: [PATCH 341/351] Revert "glusterd: enable brick multiplexing by
e7a346
 default"
e7a346
e7a346
This reverts commit 2a80ccb39ea7f4ef5c801ad78b43e4bdc23a3c64.
e7a346
e7a346
brick multiplexing at stand alone RHGS has been decided to be turned
e7a346
off.
e7a346
e7a346
Label: DOWNSTREAM ONLY
e7a346
e7a346
BUG: 1615440
e7a346
Change-Id: Iaf8bd8a637ec16c66952ef8947e835174279c9a2
e7a346
Signed-off-by: Atin Mukherjee  <amukherj@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/146881
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, 21 insertions(+), 3 deletions(-)
e7a346
e7a346
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
e7a346
index e071b7d..7917d66 100644
e7a346
--- a/cli/src/cli-cmd-parser.c
e7a346
+++ b/cli/src/cli-cmd-parser.c
e7a346
@@ -1739,6 +1739,24 @@ 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 d022532..6dfd819 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,         "enable"},
e7a346
+        { GLUSTERD_BRICK_MULTIPLEX_KEY,         "disable"},
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 80204e4..372d5f4 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
e7a346
@@ -111,7 +111,7 @@ is_brick_mx_enabled (void)
e7a346
         if (!ret)
e7a346
                 ret = gf_string2boolean (value, &enabled);
e7a346
 
e7a346
-        return ret ? _gf_true : enabled;
e7a346
+        return ret ? _gf_false : 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 8cc756a..474587a 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
e7a346
@@ -3506,7 +3506,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
e7a346
         /* Brick multiplexing options */
e7a346
         { .key         = GLUSTERD_BRICK_MULTIPLEX_KEY,
e7a346
           .voltype     = "mgmt/glusterd",
e7a346
-          .value       = "on",
e7a346
+          .value       = "off",
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