summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-04-13 02:42:12 +0100
committerVijay Bellur <vbellur@redhat.com>2015-05-09 08:35:14 -0700
commit99b778cbe179104af602b6eedebd31695bec16ae (patch)
tree5352721732f773b117b4a1c771577cedfaf329f4 /cli/src/cli-rpc-ops.c
parent5fd6b3b7e2881d21a1b19fb22366e905314d71bc (diff)
glusterd: support for tier volumes 'detach start' and 'detach commit'
Back port of http://review.gluster.org/10108 These commands work in a manner analagous to rebalancing when removing a brick. The existing migration daemon detects "detach start" and switches to moving data off the hot tier. While in this state all lookups are directed to the cold tier. gluster v detach-tier <vol> start gluster v detach-tier <vol> commit The status and stop cli commands shall be submitted separately. >Change-Id: I24fda5cc3ba74f5fb8aa9a3234ad51f18b80a8a0 >BUG: 1205540 >Signed-off-by: Dan Lambright <dlambrig@redhat.com> >Signed-off-by: root <root@localhost.localdomain> >Signed-off-by: Dan Lambright <dlambrig@redhat.com> >Reviewed-on: http://review.gluster.org/10108 >Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Change-Id: I212d748d077fb5870ee84b316c653acbafbea3f7 BUG: 1220047 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10708 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 5361e83a1f6..932fe5f8cb7 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -56,6 +56,10 @@ extern rpc_clnt_prog_t *cli_rpc_prog;
extern int cli_op_ret;
extern int connected;
+int32_t
+gf_cli_remove_brick (call_frame_t *frame, xlator_t *this,
+ void *data);
+
char *cli_vol_type_str[] = {"Distribute",
"Stripe",
"Replicate",
@@ -1355,11 +1359,14 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type)
/* Check if status is NOT_STARTED, and continue early */
memset (key, 0, 256);
snprintf (key, 256, "status-%d", i);
+
ret = dict_get_int32 (dict, key, (int32_t *)&status_rcd);
if (ret) {
+ gf_log ("cli", GF_LOG_TRACE, "count %d %d", count, i);
gf_log ("cli", GF_LOG_TRACE, "failed to get status");
goto out;
}
+
if (GF_DEFRAG_STATUS_NOT_STARTED == status_rcd)
continue;
@@ -2245,6 +2252,7 @@ gf_cli_remove_brick_cbk (struct rpc_req *req, struct iovec *iov,
}
switch (cmd) {
+ case GF_OP_CMD_DETACH_START:
case GF_OP_CMD_START:
cmd_str = "start";
@@ -3835,30 +3843,7 @@ int32_t
gf_cli_detach_tier (call_frame_t *frame, xlator_t *this,
void *data)
{
- gf_cli_req req = {{0,} };
- int ret = 0;
- dict_t *dict = NULL;
- char *volname = NULL;
-
- if (!frame || !this || !data) {
- ret = -1;
- goto out;
- }
-
- dict = data;
-
- ret = cli_to_glusterd (&req, frame, gf_cli_remove_brick_cbk,
- (xdrproc_t) xdr_gf_cli_req, dict,
- GLUSTER_CLI_DETACH_TIER, this,
- cli_rpc_prog, NULL);
-
-
-out:
- gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret);
-
- GF_FREE (req.dict.dict_val);
-
- return ret;
+ return gf_cli_remove_brick(frame, this, data);
}