From a8260044291cb6eee44974d8c52caa9f4cfb3993 Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Mon, 30 Mar 2015 14:27:44 -0400 Subject: glusterd: Support distributed replicated volumes on hot tier We did not set up the graph properly for hot tiers with replicated subvolumes. Also add check that the file has not already been moved by another replicated brick on the same node. Change-Id: I9adef565ab60f6774810962d912168b77a6032fa BUG: 1206517 Signed-off-by: Dan Lambright Reviewed-on: http://review.gluster.org/10054 Reviewed-by: Joseph Fernandes Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- cli/src/cli-cmd-parser.c | 5 ++++- cli/src/cli-cmd-volume.c | 7 ++++--- cli/src/cli.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 7c03ae228fd..a334fd931bf 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1441,7 +1441,7 @@ out: int32_t cli_cmd_volume_add_brick_parse (const char **words, int wordcount, - dict_t **options) + dict_t **options, int *ret_type) { dict_t *dict = NULL; char *volname = NULL; @@ -1559,6 +1559,9 @@ parse_bricks: *options = dict; out: + if (ret_type) + *ret_type = type; + if (ret) { gf_log ("cli", GF_LOG_ERROR, "Unable to parse add-brick CLI"); if (dict) diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 5436c76bcc2..9c61c3f541f 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -787,7 +787,7 @@ cli_cmd_volume_add_brick_cbk (struct cli_state *state, if (!frame) goto out; - ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options); + ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options, 0); if (ret) { cli_usage_out (word->pattern); parse_error = 1; @@ -847,12 +847,13 @@ cli_cmd_volume_attach_tier_cbk (struct cli_state *state, int parse_error = 0; gf_answer_t answer = GF_ANSWER_NO; cli_local_t *local = NULL; + int type = 0; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto out; - ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options); + ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options, &type); if (ret) { cli_usage_out (word->pattern); parse_error = 1; @@ -872,7 +873,7 @@ cli_cmd_volume_attach_tier_cbk (struct cli_state *state, if (ret) goto out; - ret = dict_set_int32 (options, "type", GF_CLUSTER_TYPE_TIER); + ret = dict_set_int32 (options, "type", type); if (ret) goto out; diff --git a/cli/src/cli.h b/cli/src/cli.h index ed2bc4aba8a..60bbcb9f620 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -249,7 +249,7 @@ cli_cmd_ganesha_parse (struct cli_state *state, const char **words, int32_t cli_cmd_volume_add_brick_parse (const char **words, int wordcount, - dict_t **options); + dict_t **options, int *type); int32_t cli_cmd_volume_remove_brick_parse (const char **words, int wordcount, -- cgit