diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-03-28 00:14:29 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-29 07:55:48 -0700 |
commit | 7cc52b98a54ef29844a302f2d4f129adcaefcbf3 (patch) | |
tree | a219f2b260b4347091973809c95c5f43a88cadd6 | |
parent | db501c73701b620be67b4c33ea16cac983dcd9b1 (diff) |
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 <amarts@redhat.com>
BUG: 787967
Reviewed-on: http://review.gluster.com/3034
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r-- | cli/src/cli-cmd-volume.c | 18 |
1 files changed, 18 insertions, 0 deletions
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) { |