summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorSamikshan Bairagya <samikshan@gmail.com>2017-05-11 15:47:22 +0530
committerRaghavendra Talur <rtalur@redhat.com>2017-05-12 19:59:02 +0000
commit175217ea52d61b97f112c06c8b0f9361b0b0de42 (patch)
tree6a1b80b2528d68349aef64fff51d9a7216780d7f /cli
parente07337d56ea91e75c48ccdc8c386ce892969ca62 (diff)
glusterd: Make reset-brick work correctly if brick-mux is on
Reset brick currently kills of the corresponding brick process. However, with brick multiplexing enabled, stopping the brick process would render all bricks attached to it unavailable. To handle this correctly, we need to make sure that the brick process is terminated only if brick-multiplexing is disabled. Otherwise, we should send the GLUSTERD_BRICK_TERMINATE rpc to the respective brick process to detach the brick that is to be reset. > Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> > Reviewed-on: https://review.gluster.org/17128 > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 74383e3ec6f8244b3de9bf14016452498c1ddcf0) Change-Id: I69002d66ffe6ec36ef48af09b66c522c6d35ac58 BUG: 1449934 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17253 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-volume.c10
-rw-r--r--cli/src/cli.c5
-rw-r--r--cli/src/cli.h9
3 files changed, 20 insertions, 4 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 5f07a057d47..16f33c5161e 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -2087,6 +2087,7 @@ cli_cmd_volume_reset_brick_cbk (struct cli_state *state,
if (!frame)
goto out;
+
ret = cli_cmd_volume_reset_brick_parse (words, wordcount, &options);
if (ret) {
@@ -2095,6 +2096,15 @@ cli_cmd_volume_reset_brick_cbk (struct cli_state *state,
goto out;
}
+ if (state->mode & GLUSTER_MODE_WIGNORE_PARTITION) {
+ ret = dict_set_int32 (options, "ignore-partition", _gf_true);
+ if (ret) {
+ gf_log ("cli", GF_LOG_ERROR, "Failed to set ignore-"
+ "partition option");
+ goto out;
+ }
+ }
+
CLI_LOCAL_INIT (local, words, frame, options);
if (proc->fn) {
diff --git a/cli/src/cli.c b/cli/src/cli.c
index c9c578f253c..1cd9eb79fe9 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -348,6 +348,11 @@ cli_opt_parse (char *opt, struct cli_state *state)
return 0;
}
+ if (strcmp (opt, "wignore-partition") == 0) {
+ state->mode |= GLUSTER_MODE_WIGNORE_PARTITION;
+ return 0;
+ }
+
if (strcmp (opt, "wignore") == 0) {
state->mode |= GLUSTER_MODE_WIGNORE;
return 0;
diff --git a/cli/src/cli.h b/cli/src/cli.h
index 27a3f3cc136..ef632d8a711 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -56,10 +56,11 @@ typedef enum {
MAX
} values;
-#define GLUSTER_MODE_SCRIPT (1 << 0)
-#define GLUSTER_MODE_ERR_FATAL (1 << 1)
-#define GLUSTER_MODE_XML (1 << 2)
-#define GLUSTER_MODE_WIGNORE (1 << 3)
+#define GLUSTER_MODE_SCRIPT (1 << 0)
+#define GLUSTER_MODE_ERR_FATAL (1 << 1)
+#define GLUSTER_MODE_XML (1 << 2)
+#define GLUSTER_MODE_WIGNORE (1 << 3)
+#define GLUSTER_MODE_WIGNORE_PARTITION (1 << 4)
#define GLUSTERD_GET_QUOTA_AUX_MOUNT_PATH(abspath, volname, path) \