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