summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorshishirng <shishirng@gluster.com>2012-01-18 15:29:15 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-19 01:31:19 -0800
commit7ba1e1ed45cee56ef51b9c04df99c976546d5d04 (patch)
treed3e4121729d51852a120ba5f067aa8a64f39b624 /cli/src/cli-cmd-volume.c
parent061d70e8195d082043b071118333b7e3173fa3ec (diff)
cluster/dht: Rebalance will be a new glusterfs process
rebalance will not use any maintainance clients. It is replaced by syncops, with the volfile. Brickop (communication between glusterd<->glusterfs process) is used for status and stop commands. Dept-first traversal of dir is maintained, but data is migrated as and when encounterd. fix-layout (dir) do Complete migrate-data of dir fix-layout (subdir) done Rebalance state is saved in the vol file, for restart-ability. A disconnect event and pidfile state determine the defrag-status Signed-off-by: shishirng <shishirng@gluster.com> Change-Id: Iec6c80c84bbb2142d840242c28db3d5f5be94d01 BUG: 763844 Reviewed-on: http://review.gluster.com/2540 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 6bea948e968..6ab1515e302 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -731,7 +731,7 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
if (!dict)
goto out;
- if (!((wordcount == 4) || (wordcount == 5) || (wordcount == 6))) {
+ if (!((wordcount == 4) || (wordcount == 5))) {
cli_usage_out (word->pattern);
parse_error = 1;
goto out;
@@ -741,7 +741,7 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
index = 3;
} else {
if (strcmp (words[3], "fix-layout") &&
- strcmp (words[3], "migrate-data")) {
+ strcmp (words[3], "start")) {
cli_usage_out (word->pattern);
parse_error = 1;
goto out;
@@ -750,7 +750,7 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
}
if (strcmp (words[index], "start") && strcmp (words[index], "stop") &&
- strcmp (words[index], "status")) {
+ strcmp (words[index], "status") && strcmp (words[index], "force")) {
cli_usage_out (word->pattern);
parse_error = 1;
goto out;
@@ -766,27 +766,19 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
goto out;
}
if (wordcount == 5) {
- ret = dict_set_str (dict, "start-type", (char *)words[3]);
- if (ret)
- goto out;
- ret = dict_set_str (dict, "command", (char *)words[4]);
- if (ret)
- goto out;
- }
-
- /* 'force' option is valid only for the 'migrate-data' key */
- if (wordcount == 6) {
- if (strcmp (words[3], "migrate-data") ||
- strcmp (words[4], "start") ||
- strcmp (words[5], "force")) {
+ if ((strcmp (words[3], "fix-layout") ||
+ strcmp (words[4], "start")) &&
+ (strcmp (words[3], "start") ||
+ strcmp (words[4], "force"))) {
cli_usage_out (word->pattern);
parse_error = 1;
goto out;
}
- ret = dict_set_str (dict, "start-type", "migrate-data-force");
+
+ ret = dict_set_str (dict, "option", (char *)words[4]);
if (ret)
goto out;
- ret = dict_set_str (dict, "command", (char *)words[4]);
+ ret = dict_set_str (dict, "command", (char *)words[3]);
if (ret)
goto out;
}
@@ -1776,7 +1768,7 @@ struct cli_cmd volume_cmds[] = {
cli_cmd_volume_remove_brick_cbk,
"remove brick from volume <VOLNAME>"},
- { "volume rebalance <VOLNAME> [fix-layout|migrate-data] {start|stop|status} [force]",
+ { "volume rebalance <VOLNAME> [fix-layout] {start|stop|status} [force]",
cli_cmd_volume_defrag_cbk,
"rebalance operations"},