From 7cc52b98a54ef29844a302f2d4f129adcaefcbf3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 28 Mar 2012 00:14:29 +0530 Subject: cli: give warning to user in add-brick if stripe count given * as it is currently not so well tested, user should get notification about possibility of problems with the volume type changes. * added warning instead of removing the feature because with keeping an option we can enhance what is there already. Change-Id: I6cf3491870ac2e50e85c5dbe15c61622a47c18cb Signed-off-by: Amar Tumballi BUG: 787967 Reviewed-on: http://review.gluster.com/3034 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-volume.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index e045964a7b9..c54cf8ec2c6 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -945,6 +945,13 @@ cli_cmd_volume_add_brick_cbk (struct cli_state *state, dict_t *options = NULL; int sent = 0; int parse_error = 0; + gf_answer_t answer = GF_ANSWER_NO; + + const char *question = "Changing the 'stripe count' of the volume is " + "not a supported feature. In some cases it may result in data " + "loss on the volume. Also there may be issues with regular " + "filesystem operations on the volume after the change. Do you " + "really want to continue with 'stripe' count option ? "; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) @@ -958,6 +965,17 @@ cli_cmd_volume_add_brick_cbk (struct cli_state *state, goto out; } + /* TODO: there are challenges in supporting changing of + stripe-count, untill it is properly supported give warning to user */ + if (dict_get (options, "stripe-count")) { + answer = cli_cmd_get_confirmation (state, question); + + if (GF_ANSWER_NO == answer) { + ret = 0; + goto out; + } + } + proc = &cli_rpc_prog->proctable[GLUSTER_CLI_ADD_BRICK]; if (proc->fn) { -- cgit